Jump to content

[SOLVED] contact form not working


callie212

Recommended Posts

I am having trouble getting this form to work. It appears to work, but I do not get the email.

 

I would appreciate any help. The form is located at www.factorytimes.com/contact.php

 

Here is my HTML file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

<title>Contact Factory Times</title>

<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="logoimg">"<img src="images/bgTOPforweb2.jpg" alt="background" width="1500" height="600" align="left" /></div>
<table width="200" id="menubox" name="menubox">
<tr>
<td colspan="3">
<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="shoutbox.html">Shoutbox</a></li>
<li><a href="issues.html">Issues</a></li>
<li><a href="staff.html">Staff</a></li>
<li><a href="sharon.php">Sharon</a></li>
<li><a href="https://milo.cs.sunyit.edu/ftimes/index.php" target="_blank">Forum</a></li>
<li><a href="contact.php">Contact</a></li>
</ul></td>
</tr>
</table>

<table width="600" id="bodyboxstaff" name="bodyboxstaff" cellpadding="0"cellspacing="0">
    <tr>
      <td valign="top"><img src="images/contact.jpg" alt="contact" width="292" height="433" /></td>
  
  <td>
  
  
<table width="306" height="433" border="0" cellpadding="0" cellspacing="5" id="stafftable">
  <tr>
    <td>

<form method="post" action="processcontact.php">

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

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />


Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
<br />
Attention:<br />
<select name="attn" size="1">
<option value=" General Question " selected="selected">General Question </option> 
<option value=" Writing Team ">Writing Team </option> 
<option value=" Design Team ">Design Team </option> 
<option value=" Publicaion Director ">Publication Director </option> 
</select>
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="8" cols=35"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
</form>

</td>
</tr>
</table>

</td>
</tr>
</table>
   
</body>
</html>

 

Here is the processcontact.php file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Factory Times - Contact us</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div id="logoimg">"<img src="images/bgTOPforweb2.jpg" alt="background" width="1500" height="600" align="left" /></div>
<table width="200" id="menubox" name="menubox">
<tr>
<td colspan="3">
<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="shoutbox.html">Shoutbox</a></li>
<li><a href="issues.html">Issues</a></li>
<li><a href="staff.html">Staff</a></li>
<li><a href="sharon.php">Sharon</a></li>
<li><a href="https://milo.cs.sunyit.edu/ftimes/index.php" target="_blank">Forum</a></li>
<li><a href="contact.php">Contact</a></li>
</ul></td>
</tr>
</table>
<table width="200" id="bodybox" name="bodybox" cellspacing="0" cellpadding="10" >

  <tr>
   <td valign="top">  
  <?php

$ip = $_POST['ip']; 
$httpref = $_POST['httpref']; 
$httpagent = $_POST['httpagent']; 
$visitor = $_POST['visitor']; 
$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 ("Please use your browser's back button.");
}

if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Please use your browser's back button."); 
}

$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("staff@factorytimes.com", $subject, $message, $from);
echo "<h2>Thank you for your message. We will respond you you as soon as we can.</h2>";
?></td>
</tr>
</table> 


</body>
</html>

 

I am probably making a simple mistake, because it seems like I have everything right. I want to make sure that when the echo statement displays you still see the general site, not a blank white background with black text, so I imputed the PHP code in the processcontact.php file in a cell, but I don't know if this is the problem.

 

 

Link to comment
Share on other sites

I have one other form, but I have the same problem. I think that the issue may be with my server. This site is hosted by my school and I just uploaded the files to a personal server and it worked. I will probably have to figure out who can help me with the PHP settings on the server. I saw an article on the web about safe_mode needing to be OFF and its listed as ON.

 

I am putting just the process scripts on my personal server and using the absolute links until I can get the problem fixed because its working that way. Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.