Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variables

Status
Not open for further replies.

bigJo

Programmer
May 7, 2002
14
CA
Hi,
I am trying to pass variables from one page to another, but it is not working.

My welcome.html file have this link:

<a href=&quot; Hi, I'm Jo! </a>

My welcome.php have this one:

<?php echo( &quot;Welcome to our Web site, $name!&quot; );?>

The variable name does not sends the value &quot;Jo&quot;, it sends only an empty string.

I am using IIS under Win XP.

Please help me.
Thanks
 
You likely have the runtime configuration directive &quot;register_globals&quot; set to &quot;off&quot;.

Try either $_GET[&quot;name&quot;] or $HTTP_GET_VARS[&quot;name&quot;]. ______________________________________________________________________
TANSTAAFL!
 
Thanks a lot sleipnir, it works just fine now.

Jo
 
You should now use the following as standard variables.

Cookie $variable_name - $_COOKIE['variable_name']
Posted $variable_name - $_POST['variable_name']
Session $variable_name - $_SESSION['variable_name']
URL $variable_name - $_GET['variable_name']
posted file uploaded - $_FILES['variable_name']
with sub values such as
$_FILES['variable_name']['name'] (original name)
$_FILES['variable_name']['size']
$_FILES['variable_name']['type']
$_FILES['variable_name']['tmp_name'] (on server)
 
you can also check your php.ini in the c:\windows dir .. for the line below is

register_globals = Off

If you turn this to on.. even though it is not recommended by php, you can use the string in the page <? echo &quot;Welcome $name&quot;;


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top