Click to See Complete Forum and Search --> : submitting a from to PHP file error??


abduljan
09-02-2002, 08:58 AM
Hi all,

I have got a form which has got 3 text boxes and a submit button. The textboxes are:

txtname, txtemail, txtcomment

I submit this form by post method to getfrom.php file. I get the values like bellow:

<html>

<head>

<title>getvalues.php</title>

</head>

<body>

<?php
print "Your name is: $txtname <br>";
print "Your Email is: $txtemail <br>";
print "Your comment is: $txtcomment <br>";
?>

</body>

</html>

but it raises the error:

Notice: Undefined variable: txtname in C:\Inetpub\iissamples\php\first.php on line 12
Your name is:

Notice: Undefined variable: txtemail in C:\Inetpub\iissamples\php\first.php on line 13
Your Email is:

Notice: Undefined variable: txtcomment in C:\Inetpub\iissamples\php\first.php on line 14
Your comment is:

How can i pass the values of the textboxes to the php file then?

abdul

yelvington
09-02-2002, 10:11 AM
This isn't an installation question, but ...

Read the release notes that came with PHP, and pay special attention to the part about _POST[] and _GET[] arrays (superglobals).