http://trentonsoupkitchen.org/phpform/use/Recipe/
-----------------------------
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Category');
pt_register('POST','RecipeName');
pt_register('POST','YourName');
pt_register('POST','Ingredients');
$Ingredients=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Ingredients);pt_register('POST','Directions');
$Directions=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Directions);if($Category=="" || $RecipeName=="" || $YourName=="" || $Ingredients=="" || $Directions=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Category: ".$Category."
Recipe Name: ".$RecipeName."
Your Name: ".$YourName."
Ingredients: ".$Ingredients."
Directions: ".$Directions."
";
$message = stripslashes($message);
mail("pjh@mccc.edu","Recipe Collection Form",$message,"From: phpFormGenerator");
?>
<!-- This is the content of the Thank you page, be careful while changing it -->
<link href="../../../task.css" rel="stylesheet" type="text/css">
<h2>Thank you!</h2>
<span class="style6">If you would like to reserve one or more <br>
copies of the cookbook, please click here.
</span><!--
<table width=50%>
<tr>
<td>Category: </td>
<td> <?php echo $Category; ?> </td>
</tr>
<tr>
<td>Recipe Name: </td>
<td> <?php echo $RecipeName; ?> </td>
</tr>
<tr>
<td>Your Name: </td>
<td> <?php echo $YourName; ?> </td>
</tr>
<tr>
<td>Ingredients: </td>
<td> <?php echo $Ingredients; ?> </td>
</tr>
<tr>
<td>Directions: </td>
<td> <?php echo $Directions; ?> </td>
</tr>
</table>
-->
<!-- Do not change anything below this line -->
<?php
}
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The idea is that in a text area you may have multiple carriage return and line feed characters (\015\012). The HTML euqivalent is <br>. It is still incorrectly implemented for your form but that is the explination.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i think i have kind of the same problem...but without a solution...
results of a form are sended in this format:
Vraag: Beste mevrouw, meneer, <br /> <br />Wij zijn op zoek naar een geschikte locatie voor een receptie met ongeveer 200 personen, op maandagavond, 13 februari 2006. De locatie zou mysterieus, speciaal, ...
moeten kunnen ingekleed worden, of al mysterieus zijn door de ligging, de omgeving... Misschien is jullie locatie in Waver ook geschikt, of Cense D'Almez natuurlijk. <br /> <br />We willen de gasten een receptie van ongeveer 2 uur aanbieden, met drank en wat hapjes, er is een speech, en indien mogelijk wordt de groep in kleine groepjes gesplitst voor een speciale activiteit (is er een mogelijkheid om iedereen in cirkels te laten zitten?) <br /> <br />Kan u laten weten of die datum nog vrij is, en kan u ons een of enkele voorstellen doen voor de receptie, met prijsindicatie? <br /> <br />Alvast hartelijk bedankt. <br /> <br />Met vriendelijke groeten, <br /> <br />Lieven <br />
So the breaks are not displayed and i get a lot of unnessary tags. In the mail-message, but also in the datafile with all results.
Anyone a solution... since i'm a novice to php...help would be welcome...and i'll learn :-) Thx
Code of process-file is:
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Language');
pt_register('POST','Company');
pt_register('POST','Title');
pt_register('POST','Name');
pt_register('POST','Firstname');
pt_register('POST','Address');
pt_register('POST','PC');
pt_register('POST','City');
pt_register('POST','Tel');
pt_register('POST','Fax');
pt_register('POST','Email');
pt_register('POST','TypeContact');
pt_register('POST','Question');
$Question=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Question);pt_register('POST','Info');
pt_register('POST','Date');
pt_register('POST','IP');
if($Name=="" || $Firstname=="" || $Address=="" || $PC=="" || $City=="" || $Tel=="" || $Email=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
$Date = date("l jS of F Y h:i:s A");
$IP = $HTTP_SERVER_VARS["REMOTE_ADDR"];
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Language: ".$Language."
Company: ".$Company."
Title: ".$Title."
Name: ".$Name."
First name: ".$Firstname."
Address: ".$Address."
PC: ".$PC."
City: ".$City."
Tel: ".$Tel."
Fax: ".$Fax."
Email: ".$Email."
TypeContact: ".$TypeContact."
Question: ".$Question."
Info: ".$Info."
Date: ".$Date."
IP: ".$IP."
";
$message = stripslashes($message);
mail("christian@tconcept.net","Contact Form - Cense d'Almez",$message,"From: $Email");
$link = mysql_connect("xxxxxxxxxxxxx","xxxxxxxx","xxxxxxxx");
mysql_select_db("xxxxxxxxxx",$link);
$query="insert into form_contact (Langue,Societe,Titre,Nom,Prenom,Adresse,CP,Localite,Tel,Fax,Email,ChoixContact,Question,Suivi,Date,IP) values ('".$Language."','".$Company."','".$Title."','".$Name."','".$Firstname."','".$Address."','".$PC."','".$City."','".$Tel."','".$Fax."','".$Email."','".$TypeContact."','".$Question."','".$Info."','".$Date."','".$IP."')";
mysql_query($query);
$make=fopen("admin/contact.csv","a");
$to_put="";
$to_put .= $Language.";".$Company.";".$Title.";".$Name.";".$Firstname.";".$Address.";".$PC.";".$City.";".$Tel.";".$Fax.";".$Email.";".$TypeContact.";".$Question.";".$Info.";".$Date.";".$IP."
";
fwrite($make,$to_put);
This happens because the message is being prepared for HTML and is only sent as text.
You have 2 options:
1.)don't prepare for html by removing this line:
$Comment=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Comment);
2.)send as html by adding the following:
on the line prior to
$message = stripslashes($message);
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From:
phpFormGenerator");
to this line
mail("chuck@comiclist.com","Form Submitted at your website",$message,$header);
In your case the easiest will be option 1. This is due to the fact you are saving to MySQL. If you still want to receive the message in html more of the process file will have to be rearranged.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
$Name=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Name);pt_register('POST','EmailAddress');
pt_register('POST','Comment');
$Comment=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Comment);if($Name=="" || $EmailAddress=="" || $Comment=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Email Address: ".$EmailAddress."
Comment: ".$Comment."
";
$message = stripslashes($message);
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From: phpFormGenerator");
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $Name."|".$EmailAddress."|".$Comment."
";
fwrite($make,$to_put);
This happens because the message is being prepared for HTML and is only sent as text.
You have 2 options:
1.)don't prepare for html by removing this line:
$Comment=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Comment);
2.)send as html by adding the following:
on the line prior to
$message = stripslashes($message);
This message is identical to the last one. Since you removed the line that inserts the <b /> into the string it appears you did not update the process.php file on your web site properly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
$Name=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Name);pt_register('POST','EmailAddress');
pt_register('POST','Comment');
if($Name=="" || $EmailAddress=="" || $Comment=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Email Address: ".$EmailAddress."
Comment: ".$Comment."
";
$message = stripslashes($message);
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From: phpFormGenerator");
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $Name."|".$EmailAddress."|".$Comment."
";
fwrite($make,$to_put);
I took your latest process.php file and form, set it up on my server. The results were as follows:
Name: T EverettEmail Address: tnteveret1@comcast.netComment: test messageTest messagetest message
I then added some minor formating and this is what I get:
Name: T Everett
Email Address: tnteveret1@comcast.net
Comment:
test message
Test message
test message
Here is the process.php file I ended up with:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name'); $Name=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Name);
pt_register('POST','EmailAddress');
pt_register('POST','Comment');
if($Name=="" || $EmailAddress=="" || $Comment=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
$error.="<li>Invalid email address entered"; $errors=1;
}
if($errors==1)
echo $error;
else {
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="\nName: ".$Name."\nEmail Address: ".$EmailAddress."\nComment: \n".$Comment."";
$message = stripslashes($message);
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From:phpFormGenerator");
echo "<li>Done";
?>
<?php
}
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I see what the problem is now. I was changing the wrong process.php. The one I need to change is located at www.comiclist.com/form/use/Comment/process.php, but when I try to enter the directory, I get:
Unable to change directory to /home/comlist/public_html/form/use/Comment! You do not seem to have access permissions! (System Error: Permission denied)
It's been that way since I created the form.
I've been changing the file at www.comiclist.com/form/forms/process.php, which my form, of course, is not using.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try these things:
1-Try changing directory permissions.
2-Try removing any .htaccess or .htpassword files.
3-Copy what you have to your PC, delete the web directories, then recreate and reload the files.
4-Get your host support person to modify the permissions for you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I enter the following in a textarea of a fom created with v2.09:
1 cup butter
1 onion, chopped very finely
2 pkgs. frozen chopped spinach
And the resulting email shows this:
1 cup butter <br />1 onion, chopped very finely <br />2 pkgs. frozen chopped spinach
What have I done wrong???
Send me the path to your form, and send me your process.php file.
http://trentonsoupkitchen.org/phpform/use/Recipe/
-----------------------------
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Category');
pt_register('POST','RecipeName');
pt_register('POST','YourName');
pt_register('POST','Ingredients');
$Ingredients=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Ingredients);pt_register('POST','Directions');
$Directions=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Directions);if($Category=="" || $RecipeName=="" || $YourName=="" || $Ingredients=="" || $Directions=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Category: ".$Category."
Recipe Name: ".$RecipeName."
Your Name: ".$YourName."
Ingredients: ".$Ingredients."
Directions: ".$Directions."
";
$message = stripslashes($message);
mail("pjh@mccc.edu","Recipe Collection Form",$message,"From: phpFormGenerator");
?>
<!-- This is the content of the Thank you page, be careful while changing it -->
<link href="../../../task.css" rel="stylesheet" type="text/css">
<h2>Thank you!</h2>
<span class="style6">If you would like to reserve one or more <br>
copies of the cookbook, please click here.
</span><!--
<table width=50%>
<tr>
<td>Category: </td>
<td> <?php echo $Category; ?> </td>
</tr>
<tr>
<td>Recipe Name: </td>
<td> <?php echo $RecipeName; ?> </td>
</tr>
<tr>
<td>Your Name: </td>
<td> <?php echo $YourName; ?> </td>
</tr>
<tr>
<td>Ingredients: </td>
<td> <?php echo $Ingredients; ?> </td>
</tr>
<tr>
<td>Directions: </td>
<td> <?php echo $Directions; ?> </td>
</tr>
</table>
-->
<!-- Do not change anything below this line -->
<?php
}
?>
Duh! I see what's causing the "problem". :-)
This is the problem:
preg_replace("/(\015\012)|(\015)|(\012)/"," <br />",
Do you still need help?
No, I'm good now, thanks.
Why is that substitution the default for textarea? It doesn't make sense to me.
Thanks.
The idea is that in a text area you may have multiple carriage return and line feed characters (\015\012). The HTML euqivalent is <br>. It is still incorrectly implemented for your form but that is the explination.
The form produces a text email. Why would it substitute HTML tabs for text?
Is the incorrect implementation a flaw in phpformgen??
Thanks.
Not sure, I'm not the designer. There are two functions that use the variables. The email and the thankyou form.
i think i have kind of the same problem...but without a solution...
results of a form are sended in this format:
Vraag: Beste mevrouw, meneer, <br /> <br />Wij zijn op zoek naar een geschikte locatie voor een receptie met ongeveer 200 personen, op maandagavond, 13 februari 2006. De locatie zou mysterieus, speciaal, ...
moeten kunnen ingekleed worden, of al mysterieus zijn door de ligging, de omgeving... Misschien is jullie locatie in Waver ook geschikt, of Cense D'Almez natuurlijk. <br /> <br />We willen de gasten een receptie van ongeveer 2 uur aanbieden, met drank en wat hapjes, er is een speech, en indien mogelijk wordt de groep in kleine groepjes gesplitst voor een speciale activiteit (is er een mogelijkheid om iedereen in cirkels te laten zitten?) <br /> <br />Kan u laten weten of die datum nog vrij is, en kan u ons een of enkele voorstellen doen voor de receptie, met prijsindicatie? <br /> <br />Alvast hartelijk bedankt. <br /> <br />Met vriendelijke groeten, <br /> <br />Lieven <br />
So the breaks are not displayed and i get a lot of unnessary tags. In the mail-message, but also in the datafile with all results.
Anyone a solution... since i'm a novice to php...help would be welcome...and i'll learn :-) Thx
Code of process-file is:
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Language');
pt_register('POST','Company');
pt_register('POST','Title');
pt_register('POST','Name');
pt_register('POST','Firstname');
pt_register('POST','Address');
pt_register('POST','PC');
pt_register('POST','City');
pt_register('POST','Tel');
pt_register('POST','Fax');
pt_register('POST','Email');
pt_register('POST','TypeContact');
pt_register('POST','Question');
$Question=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Question);pt_register('POST','Info');
pt_register('POST','Date');
pt_register('POST','IP');
if($Name=="" || $Firstname=="" || $Address=="" || $PC=="" || $City=="" || $Tel=="" || $Email=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
$Date = date("l jS of F Y h:i:s A");
$IP = $HTTP_SERVER_VARS["REMOTE_ADDR"];
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Language: ".$Language."
Company: ".$Company."
Title: ".$Title."
Name: ".$Name."
First name: ".$Firstname."
Address: ".$Address."
PC: ".$PC."
City: ".$City."
Tel: ".$Tel."
Fax: ".$Fax."
Email: ".$Email."
TypeContact: ".$TypeContact."
Question: ".$Question."
Info: ".$Info."
Date: ".$Date."
IP: ".$IP."
";
$message = stripslashes($message);
mail("christian@tconcept.net","Contact Form - Cense d'Almez",$message,"From: $Email");
$link = mysql_connect("xxxxxxxxxxxxx","xxxxxxxx","xxxxxxxx");
mysql_select_db("xxxxxxxxxx",$link);
$query="insert into form_contact (Langue,Societe,Titre,Nom,Prenom,Adresse,CP,Localite,Tel,Fax,Email,ChoixContact,Question,Suivi,Date,IP) values ('".$Language."','".$Company."','".$Title."','".$Name."','".$Firstname."','".$Address."','".$PC."','".$City."','".$Tel."','".$Fax."','".$Email."','".$TypeContact."','".$Question."','".$Info."','".$Date."','".$IP."')";
mysql_query($query);
$make=fopen("admin/contact.csv","a");
$to_put="";
$to_put .= $Language.";".$Company.";".$Title.";".$Name.";".$Firstname.";".$Address.";".$PC.";".$City.";".$Tel.";".$Fax.";".$Email.";".$TypeContact.";".$Question.";".$Info.";".$Date.";".$IP."
";
fwrite($make,$to_put);
header("Refresh: 0;url=http://www.censedalmez.be/pages/en/form_ok.htm");
This happens because the message is being prepared for HTML and is only sent as text.
You have 2 options:
1.)don't prepare for html by removing this line:
$Comment=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Comment);
2.)send as html by adding the following:
on the line prior to
$message = stripslashes($message);
add this code
$header = "From: phpFormGenerator\r\n" .
"Content-Type: text/html; charset=iso-8859-1\r\n" ;
then change this line
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From:
phpFormGenerator");
to this line
mail("chuck@comiclist.com","Form Submitted at your website",$message,$header);
In your case the easiest will be option 1. This is due to the fact you are saving to MySQL. If you still want to receive the message in html more of the process file will have to be rearranged.
If I send a comment to myself via my form that reads:
test message
test message
test message
I receive by email as:
test message <br />test message <br />test message
The form is at http://www.comiclist.com/feedback.html.
The process.php is as follows:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
$Name=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Name);pt_register('POST','EmailAddress');
pt_register('POST','Comment');
$Comment=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Comment);if($Name=="" || $EmailAddress=="" || $Comment=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Email Address: ".$EmailAddress."
Comment: ".$Comment."
";
$message = stripslashes($message);
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From: phpFormGenerator");
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $Name."|".$EmailAddress."|".$Comment."
";
fwrite($make,$to_put);
header("Refresh: 0;url=http://www.comiclist.com/thankyou.html");
?><?php
}
?>
This happens because the message is being prepared for HTML and is only sent as text.
You have 2 options:
1.)don't prepare for html by removing this line:
$Comment=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Comment);
2.)send as html by adding the following:
on the line prior to
$message = stripslashes($message);
add this code
$header = "From: phpFormGenerator\r\n" .
"Content-Type: text/html; charset=iso-8859-1\r\n" ;
then change this line
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From:
phpFormGenerator");
to this line
mail("chuck@comiclist.com","Form Submitted at your website",$message,$header);
This message is identical to the last one. Since you removed the line that inserts the <b /> into the string it appears you did not update the process.php file on your web site properly.
Process.php is now:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
$Name=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Name);pt_register('POST','EmailAddress');
pt_register('POST','Comment');
if($Name=="" || $EmailAddress=="" || $Comment=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Email Address: ".$EmailAddress."
Comment: ".$Comment."
";
$message = stripslashes($message);
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From: phpFormGenerator");
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $Name."|".$EmailAddress."|".$Comment."
";
fwrite($make,$to_put);
header("Refresh: 0;url=http://www.comiclist.com/thankyou.html");
?><?php
}
?>
And this is what I get:
Name: chuck
Email Address: clepage@thig.com
Comment: test message <br />test message <br />test message
Did I delete the wrong line?
Well, I saved the changes, I'm not certain how else to update the file. I will research further.
I took your latest process.php file and form, set it up on my server. The results were as follows:
Name: T EverettEmail Address: tnteveret1@comcast.netComment: test messageTest messagetest message
I then added some minor formating and this is what I get:
Name: T Everett
Email Address: tnteveret1@comcast.net
Comment:
test message
Test message
test message
Here is the process.php file I ended up with:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name'); $Name=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Name);
pt_register('POST','EmailAddress');
pt_register('POST','Comment');
if($Name=="" || $EmailAddress=="" || $Comment=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*"."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
$error.="<li>Invalid email address entered"; $errors=1;
}
if($errors==1)
echo $error;
else {
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="\nName: ".$Name."\nEmail Address: ".$EmailAddress."\nComment: \n".$Comment."";
$message = stripslashes($message);
mail("chuck@comiclist.com","Form Submitted at your website",$message,"From:phpFormGenerator");
echo "<li>Done";
?>
<?php
}
?>
I see what the problem is now. I was changing the wrong process.php. The one I need to change is located at www.comiclist.com/form/use/Comment/process.php, but when I try to enter the directory, I get:
Unable to change directory to /home/comlist/public_html/form/use/Comment! You do not seem to have access permissions! (System Error: Permission denied)
It's been that way since I created the form.
I've been changing the file at www.comiclist.com/form/forms/process.php, which my form, of course, is not using.
Try these things:
1-Try changing directory permissions.
2-Try removing any .htaccess or .htpassword files.
3-Copy what you have to your PC, delete the web directories, then recreate and reload the files.
4-Get your host support person to modify the permissions for you.
Thank you all for your help. Once I got home, I contacted my host, who changed the permissions. Once they did that, the form would not work at all.
I made a new form which is working now, without the <br> issue.
Sorry guys for being a stone head, but what was the problem?
Should i remove " <br />" with its commas?
I have the same problem
Ok, i think i got it...
Whole code between 2 "pt_register" has to be gone. I think :) Sorry.