It's the good ole' register_globals feature...

You'll need to either turn register_globals on in your php.ini file or access the 
variables from their respective arrays ($_SERVER,$_GET,$_POST)... since your form 
method is post it will be: $_POST['vname'].

Make sense?

If you put this at the top of your page it will extract these all for you:

if (!empty($_SERVER))
if (!empty($_GET)) {
} else if (!empty($HTTP_GET_VARS)) {

if (!empty($_POST)) {
} else if (!empty($HTTP_POST_VARS)) {

<>< Ryan

-----Original Message-----
From: Poon, Kelvin (Infomart) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 2:12 PM
Subject: [PHP-DB] Simple PHP Script


I am new to PHP and had just written a simple php script to get things
started.  I have the following code:

if($submit1) {
echo "hello $vname";
} else {
<form action="thispage.php" method=post>
<tr><td>Input yourname</td><td><input type=text name=vname></td></tr>
<tr><td colspan=2><input type=submit name=submit1></td></tr>

So this page is suppose to display a input box and a submit button and once
you enter ur name and press the button, it should show Hello [ur name] and
the input box at the bottom of it and the button below and the process

I tried running it and inputted some text and pressed the button, and the
Hello [ur name] didn't show up, it just display an input box and the submit

Can someone please help me?

Thanks a lot


PHP Database Mailing List (
To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to