View Full Version : Recently Not Working PHP Form Mailer...


weezer_rocks182
06-28-2003, 07:36 AM
i have a PHP form mailer that worked for about a month, but no it has unexpectedly stopped working. it gives me no error message, and after filling out the form it takes me to the thank you page, but no mail is sent. heres the HTML for my form:

(and yes, ALL paths are correct.)

<form action="http://kwp.scottshriner.net/php/feedback/feedback.php" method="POST">
<font color=a59f6a><B>Your Name:</b></font></td>
<td>
<input type="text" size="27" name="name" class="form"></td></tr>
<tr><td>
<font color=a59f6a><B>Your E-mail Address:</td>
<td><input type="text" size="27" name="email" class="form">
</td></tr><tr><td>
<font color=a59f6a><B>Subject:
</td><td>
<select name="subject" class="form">
<option>---CHOOSE ONE---</option>
<option value="Question">Question</option>
<option value="Comment">Comment</option>
<option value="Suggestion">Suggestion</option>
<option value="Broken Link">Broken Link Found</option>
<option value="I Want To Be Linked">I Want To Be Linked</option>
<option value="Other">Other</option>
</select></td></tr>
<tr><td>
<font color=a59f6a><B>Your Message:</td><td>
<textarea name="comments" rows="5" cols="29" class="form"></textarea><br>
</td</tr><tr><td><font color=f9fdc3></td><td>
<input type="submit" name="submit" value="Send Me An Email">&nbsp;
<input type="reset" name="clear" value="Clear Everything"></td></tr></table>
</form>

and my PHP coding:

<?php

#recipient's email address
$to = "weezer_rocks182@hotmail.com";

#subject of the message
$re = $subject;
$extras = "----------------------------\n" . "· Host: \t\t[ " . $REMOTE_ADDR . " ] " . gethostbyaddr($REMOTE_ADDR) . "\n· Client: \t\t[ " . $ip . " ] " . gethostbyaddr($ip) . "\n· User Agent: \t" . $HTTP_USER_AGENT;


#message from the contact form
$msg = "\n\nName: $name\n\nE-Mail Address: $email\n\nComments: $comments";

#send the email
mail ($to, $re, $msg, $extras);


?>
<font color=a59f6a face="century gothic"><h1><I><center>Thank you!</i></h1>
<P>
Thanks for sending me feedback!! Your comments/questions are greatly appreciated.

Please test it out on your own and see if it works.

Ökii
06-28-2003, 11:03 AM
what version of PHP is your host now running and have they recently switched to register_globals = OFF from a prior ON setting?

the PHP distro defaults to reg_globs = off since about version 4.2, so you may need to update your code, specifically your variable access calls.

basically all super global variables are now accessed through their scope arrays rather than directly - eg

$posted_variable is now $_POST['posted_variable'];
and
$server_variable is now $_SERVER['server_variable']; // things like PHP_SELF and stuff.

for more information, read
http://forums.devnetwork.net/viewtopic.php?t=511

bellportal
06-28-2003, 03:39 PM
Has your host suddenly stopped you using the mail() command? You should check. Most free hosts either limit the use, or ban it all together.

HTH,

weezer_rocks182
06-28-2003, 08:23 PM
i really dont know. weird thing is, i have an upload CGI script which emails me everytime theres an upload, and also has now stopped emailing me. the guy who hosts me is away for the weekend, so i dont know what to do.