+ Reply to Thread
Results 1 to 5 of 5

Thread: PHP Help

  1. #1
    Whitewolf is offline x10Hosting Member Whitewolf is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    24

    PHP Help

    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

  2. #2
    conker87 is offline x10Hosting Member conker87 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    65

    Re: PHP Help

    Try:

    PHP Code:
    <?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" );
    ?>

  3. #3
    arsonistx is offline x10 Lieutenant arsonistx is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    308

    Re: PHP Help

    Yeah, I would suggest using the POST function, it seems to be a lot more popular, therefore it is probably more efficient.

  4. #4
    conker87 is offline x10Hosting Member conker87 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    65

    Re: PHP Help

    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.

  5. #5
    Whitewolf is offline x10Hosting Member Whitewolf is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    24

    Re: PHP Help

    Thanks guys helped alot

+ Reply to Thread

Similar Threads

  1. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  2. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  3. Sigo con problemas con phpbb2
    By reciecho in forum Soporte
    Replies: 7
    Last Post: 10-20-2007, 06:28 PM
  4. "PHP Startup: Invalid Library" - Interesting error
    By javaguy78 in forum Free Hosting
    Replies: 5
    Last Post: 03-27-2007, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers