|
Posted by Rik on 01/10/07 07:53
Nathan wrote:
> Hi,
>
> I have a simple php script which takes a variable from the url and
> prints it out. I've recently changed linux cpanel/whm servers and it
> no
>
> longer runs. What modules do I need to install/how do I get it running
> again?
>
> The script is shown below:
>
> Example url:
>
> http://www.domain.com/file.php?variable=helloworld
>
> The following code is in the <head> of the php file:
>
> <?php
> $qsdata = split("&", $QUERY_STRING);
> foreach( $qsdata as $pair ) {
> $kv = split("=", $pair);
> $QS[$kv[0]] = rawurldecode($kv[1]);
>
> }
>
>>
>
> The following code is in the <body> of the php file where a variable
> needs to be printed out:
>
> <?php print "$QS[variable]"; ?>
>
Check register_globals in the manual, and learn to use the $_GET array.
Omitting the first script and doing a search/replace on $QS to $_GET in the
rest of the files should do it.
--
Rik Wasmus
Navigation:
[Reply to this message]
|