I an using a really simple PHP script to process a contact form.
Here’s the problem I have. I want to supress the html line break characters when a user hits return in the text area comments box.
As it is now, if they hit return the email generated by the php script puts in <br /> <br />.
Is there a way I can suppress these characters??
The PHP code I’m using is below…
Thanks!
Joseph
<?php
include(“global.inc.php”);
$errors=0;
$error=”The following errors occured while processing your form input.<ul>”;
pt_register(‘POST’,’name’);
pt_register(‘POST’,’address’);
pt_register(‘POST’,’city’);
pt_register(‘POST’,’state’);
pt_register(‘POST’,’zip’);
pt_register(‘POST’,’email’);
pt_register(‘POST’,’dob’);
pt_register(‘POST’,’homephone’);
pt_register(‘POST’,’workphone’);
pt_register(‘POST’,’comments’);
$comments=preg_replace(“/( 15 12)|( 15)|( 12)/”,” <br />”, $comments);pt_register(‘POST’,’details’);
if($name==”” || $email==””){
$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=”Name: “.$name.”
Address: “.$address.”
City: “.$city.”
State: “.$state.”
Zip Code: “.$zip.”
Email Address: “.$email.”
Date of Birth: “.$dob.”
Home Phone #: “.$homephone.”
Work Phone #: “.$workphone.”
Comment Form: “.$comments.”
Radial Button Selection: “.$details.”
“;
$message = stripslashes($message);
mail(“
header(“Refresh: 0;url=http:/thankyou.html”);
?><?php
}
?>