Cannot process forms in PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Village

    Cannot process forms in PHP

    I have installed PHP several times using tutorials and information from
    a book, but each time I am able to use basic functions, such as date(),
    but when it comes to processing forms it shows up nothing.

    I know it can't be my programming as i have copied the book word for
    word and even use the example from their website.

    All i am trying to do is send information from a HTML form to a PHP
    page which will then display what was entered into the form. The code i
    have used on the PHP page is shown below:

    <?php
    /* This page receives and handles the data generated by "form.htm". */
    print "Your first name is $FirstName.<BR> \n";
    print "Your last name is $LastName.<BR>\ n";
    print "Your E-mail address is $email.<BR>\n";
    print "This is what you had to say:<BR>\n$Comm ents<BR>\n";
    ?>

    Is there anything wrong with this, or have i installed PHP incorrectly.
    Any Suggestions?
    Thank you very much.

  • Erwin Moller

    #2
    Re: Cannot process forms in PHP

    Village wrote:
    [color=blue]
    > I have installed PHP several times using tutorials and information from
    > a book, but each time I am able to use basic functions, such as date(),
    > but when it comes to processing forms it shows up nothing.
    >
    > I know it can't be my programming as i have copied the book word for
    > word and even use the example from their website.
    >
    > All i am trying to do is send information from a HTML form to a PHP
    > page which will then display what was entered into the form. The code i
    > have used on the PHP page is shown below:
    >
    > <?php
    > /* This page receives and handles the data generated by "form.htm". */
    > print "Your first name is $FirstName.<BR> \n";
    > print "Your last name is $LastName.<BR>\ n";
    > print "Your E-mail address is $email.<BR>\n";
    > print "This is what you had to say:<BR>\n$Comm ents<BR>\n";
    > ?>
    >
    > Is there anything wrong with this, or have i installed PHP incorrectly.
    > Any Suggestions?
    > Thank you very much.[/color]


    Hi again,

    See my last suggestion.

    Again you didn't show us all code.
    Show us your formcode too.

    Maybe you are relying on register_global s is on?
    That sucks, and should be disabled.

    Some old (and bad) code for PHP gives examples that rely on registerglobals
    to be on.
    Do not follow that.
    Just use the superglobal $_POST[] (for post) and $_GET[] (for getting name
    value pairs from the url.)

    Regards,
    Erwin Moller

    Comment

    Working...