Dear List Members,
Is anyone used phpformgenerator v3.0 BETA ? I have tried several times but it displays the following messages …..it seems that while compiling zip file (config.inc.php) is missing somewhere …can anyone advise or help me on this ??
------------------------Errors Displayed after filling the form-----------------
Warning: main(config.inc.php) : failed to open stream: No such file or directory in /home/mustafac/public_html/form/tmp/persistent/form174724/processor.php on line 5
Warning: main(config.inc.php) : failed to open stream: No such file or directory in /home/mustafac/public_html/form/tmp/persistent/form174724/processor.php on line 5
Warning: main(config.inc.php) : failed to open stream: No such file or directory in /home/mustafac/public_html/form/tmp/persistent/form174724/processor.php on line 5
Warning: main() : Failed opening 'config.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mustafac/public_html/form/tmp/persistent/form174724/processor.php on line 5
I would greatly appreciate some swift and positive reply in this regard.
phplover
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The config file is typically meant to contain more sensitive db, username, and password information. If you have this line in your processor.php file yet it was not included in the zip package you received just delete this line from the processor.php file.
If the config file was included then you just need to make sure it is in the right place and that the include statement in the processor.php file has the right path information to find the file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi tnteveret1
First of all I would like to thank you for posting a reply on my problem.
As per your email, I checked and found that the processor.php had that line
include("config.inc.php");
which I removed, saved the new file with same name and extension and uploaded to the server.
After punching the dummy data in 2 columns when I clicked the SUBMIT button, my browser displayed the following error.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Parse error: syntax error, unexpected T_VARIABLE in /home/godhrawa/public_html/tmp/persistent/form175188/processor.php on line 1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I have checked several times but couldn't diagnose the problem.
Can you please help me to rectify this problem as I need to upload the form asap.
Thanks.
phplover.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This means you either have a syntax error or you have a variable name that starts with a number.
${some number character}{anything else}
when all variables should be
${some alpha character}{anything else}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear tnteveret1,
Thanks for your swift reply once again. I couldn't find the error so I am forwarding the processor.php file here for your kind review.
Please let me know what could be the problem or should I create the new form. Also advise, if I create this form using UBUNTU (Linux) do you think it would give all these errors which I am experiencing ???
---------processor.php-----------------------(after removing include (config.inc.php)-------------------
There is nothing wrong with this file so maybe what you posted to your site has some extra characters in line 1.
The other thing you can do is take out the "$where_form_is" line since it is not used.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear tnteveret1
Thanks once again for your kind reply.
Still no luck with that removal of "$where_form_is" line ………..
Have you used this v3.0 BETA ? Did you encounter such problems while Zipping the final layout of the form ??? I am using Windows XP at home ……can this be the problem ??? Should I try Ubuntu (Linux) ????
Please advise soon as time is running out for me.
Thanks & Regards
PHPLOVER.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have used 3.0 many times without any issues. If you want to zip up your entire form and send it to me in an email I will evaluate what you have. I'm not sure what else you can do.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm offering to help you fix a form you intend to use. If you want this help, zip up the one you intend to use. I would need the form.html and processor.php file. I can copy all the rest from an existing form.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear tnteveret1,
Thanks for your kind and swift replies.
Here you go ……I am using forum for the 1st time so no idea how to send the attachment here …..sending you files seperately.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>form - created by phpFormGenerator</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><link href="style.css" rel="stylesheet" type="text/css">
<!- calendar stuff ->
<link rel="stylesheet" type="text/css" href="calendar/calendar-blue2.css" />
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>
<!- END calendar stuff ->
<!- expand/collapse function ->
<SCRIPT type=text/javascript>
<!-
function collapseElem(obj)
{
var el = document.getElementById(obj);
el.style.display = 'none';
}
function expandElem(obj)
{
var el = document.getElementById(obj);
el.style.display = '';
}
//->
</SCRIPT>
<!- expand/collapse function ->
<!- expand/collapse function ->
<SCRIPT type=text/javascript>
<!-
// collapse all elements, except the first one
function collapseAll()
{
var numFormPages = 1;
</form>
<!- end of form ->
<!- close the display stuff for this page ->
</ul></div><div id="footer"><p class="footer"><a class=footer href=http://phpformgen.sourceforge.net>Generated by phpFormGenerator</a></p></div>
Dear tnteveret1, I am have just zip this new form with only 2 fields i.e. First Name & Last Name only. Again I see there is (config.inc.php) in processor.php ……I dont why its there as i dont see any such functions in any of the files.
Awaiting your reply.
PHPLOVER
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear List Members,
Is anyone used phpformgenerator v3.0 BETA ? I have tried several times but it displays the following messages …..it seems that while compiling zip file (config.inc.php) is missing somewhere …can anyone advise or help me on this ??
------------------------Errors Displayed after filling the form-----------------
Warning: main(config.inc.php) : failed to open stream: No such file or directory in /home/mustafac/public_html/form/tmp/persistent/form174724/processor.php on line 5
Warning: main(config.inc.php) : failed to open stream: No such file or directory in /home/mustafac/public_html/form/tmp/persistent/form174724/processor.php on line 5
Warning: main(config.inc.php) : failed to open stream: No such file or directory in /home/mustafac/public_html/form/tmp/persistent/form174724/processor.php on line 5
Warning: main() : Failed opening 'config.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mustafac/public_html/form/tmp/persistent/form174724/processor.php on line 5
I would greatly appreciate some swift and positive reply in this regard.
phplover
The config file is typically meant to contain more sensitive db, username, and password information. If you have this line in your processor.php file yet it was not included in the zip package you received just delete this line from the processor.php file.
If the config file was included then you just need to make sure it is in the right place and that the include statement in the processor.php file has the right path information to find the file.
Hi tnteveret1
First of all I would like to thank you for posting a reply on my problem.
As per your email, I checked and found that the processor.php had that line
include("config.inc.php");
which I removed, saved the new file with same name and extension and uploaded to the server.
After punching the dummy data in 2 columns when I clicked the SUBMIT button, my browser displayed the following error.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Parse error: syntax error, unexpected T_VARIABLE in /home/godhrawa/public_html/tmp/persistent/form175188/processor.php on line 1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I have checked several times but couldn't diagnose the problem.
Can you please help me to rectify this problem as I need to upload the form asap.
Thanks.
phplover.
This means you either have a syntax error or you have a variable name that starts with a number.
${some number character}{anything else}
when all variables should be
${some alpha character}{anything else}
Dear tnteveret1,
Thanks for your swift reply once again. I couldn't find the error so I am forwarding the processor.php file here for your kind review.
Please let me know what could be the problem or should I create the new form. Also advise, if I create this form using UBUNTU (Linux) do you think it would give all these errors which I am experiencing ???
---------processor.php-----------------------(after removing include (config.inc.php)-------------------
<?php
$where_form_is="http://".$_SERVER.strrev(strstr(strrev($_SERVER),"/"));
$link = mysql_connect($db_host,$db_user,$db_pass);
if(!$link) die ('Could not connect to database: '.mysql_error());
mysql_select_db($db_name,$link);
$query = "INSERT into `".$db_table."` (field_1,field_2) VALUES ('" . $_POST . "','" . $_POST . "')";
mysql_query($query);
mysql_close($link);
mail("abbas@mustafacomputers.com","phpFormGenerator - Form submission","Form data:
First Name: " . $_POST . "
Last Name: " . $_POST . "
powered by phpFormGenerator.
");
include("confirm.html");
?>
Awaiting your reply.
phplover
There is nothing wrong with this file so maybe what you posted to your site has some extra characters in line 1.
The other thing you can do is take out the "$where_form_is" line since it is not used.
Dear tnteveret1
Thanks once again for your kind reply.
Still no luck with that removal of "$where_form_is" line ………..
Have you used this v3.0 BETA ? Did you encounter such problems while Zipping the final layout of the form ??? I am using Windows XP at home ……can this be the problem ??? Should I try Ubuntu (Linux) ????
Please advise soon as time is running out for me.
Thanks & Regards
PHPLOVER.
I have used 3.0 many times without any issues. If you want to zip up your entire form and send it to me in an email I will evaluate what you have. I'm not sure what else you can do.
Dear tnteveret1,
Thanks for your reply.
What should I send ? That ZIP file ? Or should I create a new form and then zip it and send it to you ?
Awaiting your reply.
PHPLOVER
I'm offering to help you fix a form you intend to use. If you want this help, zip up the one you intend to use. I would need the form.html and processor.php file. I can copy all the rest from an existing form.
Dear tnteveret1,
Thanks for your kind and swift replies.
Here you go ……I am using forum for the 1st time so no idea how to send the attachment here …..sending you files seperately.
---------------------form.html--------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>form - created by phpFormGenerator</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><link href="style.css" rel="stylesheet" type="text/css">
<!- calendar stuff ->
<link rel="stylesheet" type="text/css" href="calendar/calendar-blue2.css" />
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>
<!- END calendar stuff ->
<!- expand/collapse function ->
<SCRIPT type=text/javascript>
<!-
function collapseElem(obj)
{
var el = document.getElementById(obj);
el.style.display = 'none';
}
function expandElem(obj)
{
var el = document.getElementById(obj);
el.style.display = '';
}
//->
</SCRIPT>
<!- expand/collapse function ->
<!- expand/collapse function ->
<SCRIPT type=text/javascript>
<!-
// collapse all elements, except the first one
function collapseAll()
{
var numFormPages = 1;
for(i=2; i <= numFormPages; i++)
{
currPageId = ('mainForm_' + i);
collapseElem(currPageId);
}
}
//->
</SCRIPT>
<!- expand/collapse function ->
<!- validate ->
<SCRIPT type=text/javascript>
<!-
function validateField(fieldId, fieldBoxId, fieldType, required)
{
fieldBox = document.getElementById(fieldBoxId);
fieldObj = document.getElementById(fieldId);
if(fieldType == 'text' || fieldType == 'textarea' || fieldType == 'password' || fieldType == 'file' || fieldType == 'phone' || fieldType == 'website')
{
if(required == 1 && fieldObj.value == '')
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
else if(fieldType == 'menu' || fieldType == 'country' || fieldType == 'state')
{
if(required == 1 && fieldObj.selectedIndex == 0)
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
else if(fieldType == 'email')
{
if((required == 1 && fieldObj.value=='') || (fieldObj.value!='' && !validate_email(fieldObj.value)))
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
}
function validate_email(emailStr)
{
apos=emailStr.indexOf("@");
dotpos=emailStr.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{
return false;
}
else
{
return true;
}
}
function validateDate(fieldId, fieldBoxId, fieldType, required, minDateStr, maxDateStr)
{
retValue = true;
fieldBox = document.getElementById(fieldBoxId);
fieldObj = document.getElementById(fieldId);
dateStr = fieldObj.value;
if(required == 0 && dateStr == '')
{
return true;
}
if(dateStr.charAt(2) != '/' || dateStr.charAt(5) != '/' || dateStr.length != 10)
{
retValue = false;
}
else // format's okay; check max, min
{
currDays = parseInt(dateStr.substr(0,2),10) + parseInt(dateStr.substr(3,2),10)*30 + parseInt(dateStr.substr(6,4),10)*365;
//alert(currDays);
if(maxDateStr != '')
{
maxDays = parseInt(maxDateStr.substr(0,2),10) + parseInt(maxDateStr.substr(3,2),10)*30 + parseInt(maxDateStr.substr(6,4),10)*365;
//alert(maxDays);
if(currDays > maxDays)
retValue = false;
}
if(minDateStr != '')
{
minDays = parseInt(minDateStr.substr(0,2),10) + parseInt(minDateStr.substr(3,2),10)*30 + parseInt(minDateStr.substr(6,4),10)*365;
//alert(minDays);
if(currDays < minDays)
retValue = false;
}
}
if(retValue == false)
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
//->
</SCRIPT>
<!- end validate ->
</head>
<body onLoad="collapseAll()">
<div id="mainForm">
<div id="formHeader">
<h2 class="formInfo">form</h2>
<p class="formInfo">my test form</p>
</div>
<BR/><!- begin form ->
<form method=post enctype=multipart/form-data action=processor.php onSubmit="return validatePage1();"><ul class=mainForm id="mainForm_1">
<li class="mainForm" id="fieldBox_1">
<label class="formFieldQuestion">First Name *</label><input class=mainForm type=text name=field_1 id=field_1 size='20' value=''></li>
<li class="mainForm" id="fieldBox_2">
<label class="formFieldQuestion">Last Name *</label><input class=mainForm type=text name=field_2 id=field_2 size='20' value=''></li>
<!- end of this page ->
<!- page validation ->
<SCRIPT type=text/javascript>
<!-
function validatePage1()
{
retVal = true;
if (validateField('field_1','fieldBox_1','text',1) == false)
retVal=false;
if (validateField('field_2','fieldBox_2','text',1) == false)
retVal=false;
if(retVal == false)
{
alert('Please correct the errors. Fields marked with an asterisk (*) are required');
return false;
}
return retVal;
}
//->
</SCRIPT>
<!- end page validaton ->
<!- next page buttons -><li class="mainForm">
<input id="saveForm" class="mainForm" type="submit" value="Submit" />
</li>
</form>
<!- end of form ->
<!- close the display stuff for this page ->
</ul></div><div id="footer"><p class="footer"><a class=footer href=http://phpformgen.sourceforge.net>Generated by phpFormGenerator</a></p></div>
</body>
</html>
-------------------------------processor.php-------------------------------------------------------------------
<?php
$where_form_is="http://".$_SERVER.strrev(strstr(strrev($_SERVER),"/"));
include("config.inc.php");
$link = mysql_connect($db_host,$db_user,$db_pass);
if(!$link) die ('Could not connect to database: '.mysql_error());
mysql_select_db($db_name,$link);
$query = "INSERT into `".$db_table."` (field_1,field_2) VALUES ('" . $_POST . "','" . $_POST . "')";
mysql_query($query);
mysql_close($link);
mail("abbas@mustafacomputers.com","phpFormGenerator - Form submission","Form data:
First Name: " . $_POST . "
Last Name: " . $_POST . "
powered by phpFormGenerator.
");
include("confirm.html");
?>
---------------------------End------------------------------
Dear tnteveret1, I am have just zip this new form with only 2 fields i.e. First Name & Last Name only. Again I see there is (config.inc.php) in processor.php ……I dont why its there as i dont see any such functions in any of the files.
Awaiting your reply.
PHPLOVER