You are here: Re: Simple PHP script doesn't work with new web host « PHP Programming Language « IT news, forums, messages
Re: Simple PHP script doesn't work with new web host

Posted by Hendri Kurniawan on 01/10/07 07:18

usenet@nathankerr.co.nz 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 severs 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]"; ?>
>
> Thanks for your help,
>
> Nathan.
>

Change $QUERY_STRING to $_SERVER['QUERY_STRING']
better yet try the following:
<?php
var_dump($_GET['variable']); // Dump request query "variable"
var_dump($_GET); // Dump all request query
?>

Hendri Kurniawan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация