For Programmers: Free Programming Magazines  


Home > Archive > PHP Installation > March 2005 > Re: [PHP-INSTALL] Problems with installation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-INSTALL] Problems with installation
Brad Kowalczyk

2005-03-07, 8:57 pm

Arild Reiten wrote:
> Have just installed PHP 4.3.9 and apache 1.3 on a WinXP computer.
> Everything seems ok, but i can not transfer variables with PHP
>
> With this call in IE http://127.0.0.1/test.php?a=1
>
> And test.php looking like this:
>
> <?php
> print "Test a=" . $a;
> ?>
>
> It just prints a=
>
> Any ideas ??
>


Your code requires register globals to be turned on, by default it is not.

You need to either turn on register globals (bad idea) or depending on
how the data was sent to the server use:
$_GET array (for vars in the url)
$_POST array (for posted forms)
$_COOKIE array (for cookie data)
$_REQUEST array (contains data from all three)

In the example above you should have:

<?php
print "Test a=" . $_GET['a'];
?>

Cheers,

--
Brad Kowalczyk
Web Developer
www.ibiscode.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com