Jump to content

[SOLVED] PHP 4.4.7 - _POST vars not showing up in generated email


dj_meatwad

Recommended Posts

Hello - first off, please forgive me if this has already been answered.  I was unable to find a solution by searching, but it's possible I didn't search on the correct terms.  In any case, here's the issue:

 

My hosting provider, Lunarpages, recently upgraded PHP from 4.4.4 to 4.4.7.  I had a couple of HTML forms that were sending data to a PHP script, which used data from said HTML form to generate, and send, an email.  After the upgrade to 4.4.7, however, the _POST variables in the PHP are not showing up in the generated email.  I'll paste the code in here now; perhaps there's something I've done incorrectly:

 

PHP code:

 

<?php

if ($_POST['user'] != "" && $_POST['requested'] ) {
$subject="Request!";
$ip=$_SERVER["REMOTE_ADDR"];
$host = $ip;
$mon=date(m);
$day=date(j);
$year=date(y);
$hour=date(g);
$min=date(i);
$sec=date(s);
$hour=$hour-2;
if($hour<=0) { $hour+=12; }
$ts = "$hour:$min:$sec on $mon/$day/$year";

$nsuser = stripslashes($user);

$body="

Your Name = $nsuser

Song Requested = $requested

Dedication = $dedication

Host: $host
Time: $ts";

$email = "From: Form <$to>";
mail($to, $subject, $body, $email);
header("Location: xxx.php");

}
?>

 

... and the HTML form that calls it:

 

<form method="post" action="req_form.php">
Your Name (required):<br>
<input type="text" name="user" style="border: 1px solid #cccccc; background-color: #ffffff;" size="26" value=""><br>
Song Requested (required, artist & song title please!):<br>
<input type="text" name="requested" style="border: 1px solid #cccccc; background-color: #ffffff;" size="26" value=""><br>
Dedication? (may be read on air):<br>
<input type="text" name="dedication" style="border: 1px solid #cccccc; background-color: #ffffff;" size="26" value=""><br>
<input type="submit" value="send" style="border: 1px solid #cccccc; background-color: #ffffff;">
</form>

 

With this, the email is generated and sent, with entirely blank fields, regardless of what the user enters into the form.

 

Again, this worked just fine with PHP 4.4.4.  Any help/advice/assistance anyone can provide here would be most appreciated.  If more information is required, please let me know.

 

Thanks in advance!

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.