www.webdeveloper.com
Results 1 to 5 of 5

Thread: really stupid question

  1. #1
    Join Date
    Jul 2003
    Posts
    7

    really stupid question

    how do I use PHP to create a form,sort of a request form so that people can go to my site and request for some things?

  2. #2
    Join Date
    Jun 2003
    Location
    Brisbane, Australia
    Posts
    53

    More info??

    If you give me a little more info i will try to help

    If you are just looking for a form processor that send you the info once filled out, that is easy.

    Reply with more info

  3. #3
    Join Date
    Feb 2003
    Location
    Aberdeen, Washington, USA
    Posts
    1,859
    Try this. Insert this in between your <body> tags:
    Code:
    <form method="post" name="feedback" action="feedback.php">
    Name:<br>
    <input type="text" class="text" name="Name" maxlength="50" width="30" size="20"><br>
    E-mail:<br>
    <input type="text" class="text" name="Email" maxlength="50" width="30" size="20"><br>
    Comments:<br>
    <textarea cols="30" rows="6" class="text" name="Comments"></textarea><br><br>
    <input class="submit" type="submit" value="Submit">
    </form>
    And make a new file called "feedback.php" and make sure its in the same dir as your form:
    PHP Code:
    <?PHP 

    $subject 
    "Feedback"
    $headers "From: Form Mailer"
    $forward 1
    $location "yourfeedbackthankyoupage.html"
    $addresses = array("you@yourdomain.com"); 

    $date date ("l, F jS, Y"); 
    $time date ("h:i A"); 

    $msg "This form was submitted on $date at $time.\n\n"

    foreach (
    $_POST as $key => $value) { 
    $msg .= ucfirst ($key) ." : "$value "\n"


    foreach (
    $addresses as $email) { 
    mail($email$subject$msg$headers); 

    if (
    $forward == 1) { 
    header ("Location:$location"); 

    else { 
    echo (
    "Thank you for submitting our form."); 


    ?>
    Hope that helps you. (Credit for this script goes to Pyro!)

  4. #4
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    If it is only going to one address, I'd use this version instead: http://forums.webdeveloper.com/showt...9543#post48748

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  5. #5
    Join Date
    Jul 2003
    Posts
    7

    Re:request list

    thnx a lot,I need one that include the users e-mail address,name,when does he/she want the item requested and the name of the item they want.I also need it to be posted on my site so other users can see. thxn a lot!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles