Hi all.
Quick question, I have just started to learn PHP, I have written a form page which would submit 4 different types of details, e.g name, email, comments etc. When I submit these details nothing is coming up on my php recieve page.
I have installed apache and php on my PC configed as Localhost. Below is the code form the php page, any help would be appreciated.
<HTML>
<HEAD
<TITLE>Form Results</TITLE>
<HEAD>
<BODY>
<?PHP
/* This page prints results from form.html */
print "Your first name is $FirstName.<BR>\n";
print "Your last name is $LastName.<BR>\n";
print "This is your comment $Comment.<BR>\n";
?>
</BODY>
</HTML>
PHP noob requires help.
Moderator: General Moderators
I'd be nice to show us your form too...
However, hoping that you haven't done any stupid mistake in the form, the problem is the following:
You are using PHP 4.2.1+
From that version and later, the names of the form inputs (text boxes etc) stopped becoming variables automatically in PHP.
You can access those results from another variable (it's really an array).
If you're using method POST, you can do this: $_POST['firstname'] etc
If you're using method GET : $_GET['firstname']
...etc...
You can read a topic about this in the same forum, it's one of the 3 Sticky topics.
However, hoping that you haven't done any stupid mistake in the form, the problem is the following:
You are using PHP 4.2.1+
From that version and later, the names of the form inputs (text boxes etc) stopped becoming variables automatically in PHP.
You can access those results from another variable (it's really an array).
If you're using method POST, you can do this: $_POST['firstname'] etc
If you're using method GET : $_GET['firstname']
...etc...
You can read a topic about this in the same forum, it's one of the 3 Sticky topics.