Jump to content

arakuna

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Posts posted by arakuna

  1. Hi,

    I am trying to test a form on my web space. I have asked the isp about php forms and they said

    "PHP scripts should be treated as cgis, therefore you should make them executable as you would a perl or shell script. Failure to do this willprobably result in the display of an 'internal server error'

    We recommend permissions of 705."

    Question 1. How do I make a php form executable and how do I set the permissions.

    Question 2. Do I need to save the php form as a cgi?

    Question 3. How can I get the below form to send an email to the person who fills out the form and a email to me also?

    Feedback.html

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

    <body>
    Please complete this form to submit your feedback. <br />
    <form action="handle_form.php" method="post">
    Mrs
    <input name="titile" type="radio" value="Mrs" />
    Mr
    <input name="title" type="radio" value="Mr" />
    Miss
    <input name="title" type="radio" value="Miss">
    Ms
    <input name="title" type="radio" value="Ms" />
    <br />
    <br />
    Name:
    <input name="name" type="text" size="20" />
    <br />
    <br />
    Email Address: <input name="email" type="text" size="20" />
    <br />
    <br />
    Response:
    <select name="response">
    <option value="excellent">This is excellent.</option>
    <option value="okay">This is okay.</option>
    <option value="boring">This is boring.</option>
    </select>
    <br />
    <br />
    Comments: <textarea name="comments" cols="30" rows="3"></textarea>
    <br />
    <input type="submit" name="submit" value="Send my feedback" />


    </form>
    </body>
    </html>

    handle_form.php

    <html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1 />
    <title>Your Feedback</title>
    </head>

    <body>
    <?php
    //handle_form.php
    //This page recieves the data from feedback.html.
    //It willreceive :title, name, email, response, comments, and submit.
    //Adjust for register_globals being off

    ini_set ('display_errors',1); //let me learn from my mistakes.
    print "Thank you {$_POST['title']]
    {$_POST['name']] for your comments. <br />";
    print "You stated that you found this example to be {$_POST['response']] and added: {$_POST['comments']]";
    ?>
    </body>
    </html>
×
×
  • 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.