Log in

View Full Version : script for a contact form is giving problems



remp
12-04-2007, 02:42 AM
Hello, i got a script for a contact form and when i put it where i want it, every code that is bellow it, won't be read by the browser... meaning that nothing else will apprear under the contact for (for example: the footer doesn't appear)
i have checked the tags for the form and they are closed. what else can it be? any help? Appreciate it...

thetestingsite
12-04-2007, 04:33 AM
We really can't help you out unless you post the code.

remp
12-04-2007, 04:53 AM
Sorry About that, here's the code:



<div id="headline">



<div id="body-left8"><div align="center">
<form action="contacto.php" onSubmit="return formCheck(this);" method="post" name="contacto.php" id="contacto.php">
<span class="style67 style71 style72">Formulario de Contacto </span> <br>
<br>
<table width="623" border="0">
<tr>
<td width="211" rowspan="2" class="style47 style47 style70"><div align="center" class="style71">
<div align="center">Las Maravillas De Dios <br>
P.O. Box 280224 <br>
Northridge, CA 91325 <br>
<br>
Tel. 818.782.4540 / Fax. 818.786.4995 </div>
</div>
<p align="center" class="style66 style47 style71">Email: MaravillasdeDios@aol.com
<p align="center" class="style55 style71"><span class=" style70 style47">Para Invitaciones Al Ministerio haga click <a href="Invitaciones.php">aqui&nbsp;</td>
<td width="6" rowspan="3" class="style47 style47 style70"><img src="images/LongDividor.jpg" width="2" height="265" /></td>
<td class="style47 style47 style70">
<form action="contacto.php" onSubmit="return formCheck(this);" method="post" name="contacto.php" id="contacto.php">

<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>


Name:<div align="left"><font face="Comic Sans MS">
<input name="name" type=text class="style46" size=40>
<span class="style62"> *</span></font></div>
Phone: <div align="left"><font size="3" face="Comic Sans MS">
<input name="phone" type=text class="style46" onblur="MM_validateForm('telefono','','NisNum');return document.MM_returnValue" size=40>
</font><font face="Comic Sans MS"><span class="style62">*</span></font></div>
Email:<br>

<input name="e-mail" type="text" class="style46" size="40">

<br>Mensaje<div align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<textarea name="coment" cols="37" rows="4" class="style46" scroll="auto"></textarea>
</font><font face="Verdana, Arial, Helvetica, sans-serif"> <span class="style62">*</span></font></div></td>
</tr>

<tr>
<td><div align="left">
<input type="submit" value="Enviar" />
</div></td>
</tr>
<tr>
<td height="25">&nbsp;</td>
<td><?php

$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['name'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];


if (eregi('http:', $notes)) {
die ("Do NOT try that! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");
}

if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! ");
}

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";

$from = "From: $visitormail\r\n";


mail("myemail", $subject, $message, $from);

?>

Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
</td>
</tr>
</table>
</form>



<span class="style39"><br>
</span> </div>
</div>
<div id="search-news1">
<div align="center"><strong>Los Angeles Convention Center</strong></strong><a href="productos.php"><img src="images/lacc_dvd.gif" alt="LA dvd" width="183" height="165" border="0" /></a><br>
<strong>Lo Mejor Del Aņo 2006</strong>
<a href="productos.php"><img src="images/dvd 2.gif" alt="LA dvd" width="178" height="165" border="0" /> </div>
</div>
<div class="clear"></div>
</div>













<div class="clear"></div>
</div>


</div>
<div id="footer">

<p class="style34"><span class="style64">My Footer</span></p>
</div>

</body>
</html>

thetestingsite
12-04-2007, 04:14 PM
The only thing I have noticed was the lack of semicolons after the variables:




Date: <?php echo $todayis; ?>
<br />
Thank You : <?php echo $visitor; ?> ( <?php echo $visitormail; ?> )
<br />
</td>
</tr>
</table>
</form>



<span class="style39"><br>
</span> </div>
</div>
<div id="search-news1">
<div align="center"><strong>Los Angeles Convention Center</strong></strong><a href="productos.php"><img src="images/lacc_dvd.gif" alt="LA dvd" width="183" height="165" border="0" /></a><br>
<strong>Lo Mejor Del Aņo 2006</strong>
<a href="productos.php"><img src="images/dvd 2.gif" alt="LA dvd" width="178" height="165" border="0" /> </div>
</div>
<div class="clear"></div>
</div>

<div class="clear"></div>
</div>


</div>
<div id="footer">

<p class="style34"><span class="style64">My Footer</span></p>
</div>

</body>
</html>


Hope this helps.

remp
12-04-2007, 08:48 PM
thanks but that didn't solve the problem... somehow, when i remove this section the problem goes away.



if (eregi('http:', $notes)) {
die ("Do NOT try that! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");
}

if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! ");
}



but i have no idea why... can you help me with that?

thetestingsite
12-04-2007, 09:07 PM
Try removing the highlighted part below:



if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))


Other than that, I can't see anything else that could be causing this problem. If this doesn't fix it, please post the link to the problem page so that we can see exactly where it is failing at.

Hope this helps.