Forum Moderators: coopster

Message Too Old, No Replies

New to PHP - Problem with variables

Variables not showing up in the output

         

ezehra

10:15 am on Aug 29, 2003 (gmt 0)

10+ Year Member



Hi

I am learning PHP and was trying out the following code:

<?php print('<input type="text" name="person" value="' . $person . '" size="15" >');
?>

<?php
print('Hi ' . $person . '' );
?>

(This is not the complete code)

When I upload it, I only see "Hi" with no variable although I am inputting the variable and it shows in the URL of the file.

How can I solve this?

Thanks

Nick_W

10:22 am on Aug 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



$_POST['person'] [php.net]

;)

Nick

ezehra

10:46 am on Aug 29, 2003 (gmt 0)

10+ Year Member



Hi

Yes i am aware of the $_POST option but I am just wondering why the

( . $person . );

is not working.

Any clues?

Thanks

coopster

3:18 pm on Aug 30, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



More than likely the register_globals variable is turned off on your server. You can check it using
php_info()
. See Using Register Globals [us2.php.net] for more information.

ezehra

6:43 am on Sep 1, 2003 (gmt 0)

10+ Year Member



That seemed to be the problem.

Thanks