PHP Help

Whitewolf

New Member
Messages
24
Reaction score
0
Points
0
Am sooo lost right now, i cannot think - have not had sleep in 3 days...

Im trying to get a mail script going for a mate of mine at his school, ive got this PHP written so far,

Code:
<?
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;
  $name = $_REQUEST['name'] ;
  $date = $_REQUEST['date'] ;
  $undate = $_REQUEST['undate'] ;

  mail( "MY EMAIL HERE (REMOVED DUE TO SPAMMERS)", "Feedback Form Results",
    $message, $name, $date, $undate, "From: $email" );
  header( "Location: /thankyou.html" );
?>

And ive got this HTML

Code:
<html><head><title>Feedback</title>
<center><img src="header.jpg" alt="WBHS" width="434" height="173" border="0" usemap="#logo" /> </center>
</head><body>


<center><form method="post" action="sendmail.php">
  Refers email address <input name="email" type="text" /><br />
<br>
  
Username to be locked <input name="name" type="text" /><br />
<br>
  
Date of Locking <input name="date" type="text" /><br />
<br>
  Date of Unlocking <input name="undate" type="text" /><br />
<br>
  
  Please Describe the reason for locking the account:<br />
  <textarea name="message" rows="15"  cols="40">
  </textarea><br />
  <input type="submit" />
</form></center>


</body></html>


I need it so it sends all the details that the user fills in, which are,

  • Refers email address
  • Username to be locked
  • Date of Locking
  • Date of Unlocking
  • Please Describe the reason for locking the account
Thanks in advance!

Rob
 

conker87

New Member
Messages
65
Reaction score
0
Points
0
Try:

PHP:
<?php
  $youremail = "<ADD>";
  $email = $_POST['email'] ;
  $message = $_POST['message'] ;
  $name = $_POST['name'] ;
  $date = $_POST['date'] ;
  $undate = $_POST['undate'] ;
  $emailmsg = "$name sent this message to you:\r\n
$message \r\n \r\n
Locking date: '$date' \r\n
Unlocking date: '$undate'";
$headers = "From: $email";

  mail($youremail, "Feedback Form Results", $emailmsg, $headers);
  header( "Location: /thankyou.html" );
?>
 

arsonistx

New Member
Messages
308
Reaction score
0
Points
0
Yeah, I would suggest using the POST function, it seems to be a lot more popular, therefore it is probably more efficient.
 

conker87

New Member
Messages
65
Reaction score
0
Points
0
REQUEST searches both GET and POST variables. Obviously, if you know you only want POST methods then us $_POST; that said if you want to get the data from URLs the us *_GET.
 
Top