PHP noob requires help.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MarKeR
Forum Newbie
Posts: 9
Joined: Mon Aug 26, 2002 7:48 am

PHP noob requires help.

Post by MarKeR »

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>
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

User avatar
Xelmepa
Forum Commoner
Posts: 41
Joined: Sat Aug 24, 2002 3:02 pm
Location: Athens, Greece
Contact:

Post by Xelmepa »

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.
MarKeR
Forum Newbie
Posts: 9
Joined: Mon Aug 26, 2002 7:48 am

Post by MarKeR »

Sorry for not reading. Thx for the help.
Post Reply