www.webdeveloper.com
Results 1 to 4 of 4

Thread: my first phph program need help

  1. #1
    Join Date
    Nov 2002
    Posts
    68

    my first phph program need help

    I am new to php and at the very beginning stages....I am doing a feeback form for a friend :
    HERE IS THE HTML CODE

    <html>
    <head>
    <title>ciscos feedbackform</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <form method="post" action="sendmail.php">
    Name: <input name="name" type="text" /><br />
    <br />
    Age: <input name="age" type="text" /><br />
    <br />
    sex: <input name="sex" type="text" /><br />
    <br />
    Email: <input name="email" type="text" /><br />
    <br />

    <input type="submit" />

    <input type="reset" name="reset" value="Reset">
    </form>
    </body>
    </html>

    AND HERE IS THE PHP PROGRAM I WROTE

    <?
    $name = $_REQUEST['name'] ;
    $age = $_REQUEST['age'] ;
    $sex = $_REQUEST['sex'] ;
    $email = $_REQUEST['email'] ;

    mail ( "tane@optusnet.com.au", "Ciscos form results","$name, $age, $sex, $email", "From: $email" ) ;
    header( "Location: http://www.ciscoscoffeeroasters.com.au/thankyou.htm" );
    ?>


    when i get the results sent to me in my email it comes to my email like this:

    name,age,sex,email

    Is there away of having the results sent to my email with question's that was asked and the answers instead of just the answers like above e.g

    name = tane
    age = 31
    location = australia
    email = tane@optusnet.com.au

  2. #2
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    You should be able to change this line

    mail ( "tane@optusnet.com.au", "Ciscos form results","$name, $age, $sex, $email", "From: $email" ) ;

    to this

    mail ( "tane@optusnet.com.au", "Ciscos form results","name = $name\nage = $age\nsex = $sex\nemail = $email", "From: $email" );

    Adam
    "If youíre not using valid HTML, then you havenít created a Web page. You may have created something else, but it isnít a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

  3. #3
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    You may want to use something more like the form processor in this thread: http://forums.webdeveloper.com/showt...&threadid=9543

    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!

  4. #4
    Join Date
    Nov 2002
    Posts
    68
    excellent thanks guys

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