• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Php not working correctly

P

phippster12

Guest
My client is trying to use php extensions. So that he can have a site with the url

blah.com/index.php?id=3. Unfortunately php file isn't reacting to the ?id= no matter what it is. I enabled php scripting, but I don't know what to do to fix this problem. Anyone know the solution.
 
This is a setting in PHP.
register_globals = on
register_globals = off

Using your PHP script example, blah.com/index.php?id=3
if register_globals is on, then you can access the variable id directly since PHP will automatically make the GET variables available to your script.

if register_globals is off, then you have to call the variable id like: $_GET['id']

There are several things you can do.

1. On a script by script basis, add the following lines to the top of your PHP script:
<?php
if(!empty($_GET)) extract($_GET);
if(!empty($_POST)) extract($_POST);
?>

2. On a site by site basis, add the following line to a .htaccess file:
php_flag register_globals 1

3. For all php scripts and sites on your server. Probably the best way, just edit your php.ini file and search for and change register_globals = on

More information is found here:
http://us2.php.net/manual/en/security.globals.php
 
BlueSparks You Da Man

BlueSparks,

Thank you so much for your timely response. The code:

<?php
if(!empty($_GET)) extract($_GET);
if(!empty($_POST)) extract($_POST);
?>

worked perfectly when I added it to all my files. Thank you so much, you saved my behind on this client. PS: YOU DA MAN.
 
Back
Top