Page 1 of 1

urgently help needed : php script not working.!

Posted: Mon Feb 11, 2008 9:01 pm
by mapperkids
Hi,

I have a site that run on php4 and I recently switched to different server, once I moved, the script not working properly, but nothing change on the script and I check the permission, mysql table all the same.

The problem is in browser, if I call something like http://www.mysite.com/whatever.php then it works perfectly.

but if some link like http://www.mysite.com/index.php?cmd=5, then it not working, just reload the same page without any error, but it works on the old server.

I think is something about the server setting or .htaccess file, but I don't have .htaccess for that site.

I check the cpanel and can't any setting that may affact that.

Could some php expect here tell me what is wrong and why cause that?

Thanks a lot !

Re: urgently help needed : php script not working.!

Posted: Mon Feb 11, 2008 9:04 pm
by Benjamin
Register globals are turned off on your new server.

Re: urgently help needed : php script not working.!

Posted: Mon Feb 11, 2008 9:43 pm
by mapperkids
how to turn it on?

put in .htaccess file?

thanks

Re: urgently help needed : php script not working.!

Posted: Tue Feb 12, 2008 8:45 am
by liljester
Register Globals is a php.ini setting that allows get and post vars to automatically be converted. If it is the issue, paste this at the top of your code:

Code: Select all

 
//  Extract GET  //
if(!empty($_GET)) { extract($_GET); }
elseif(!empty($HTTP_GET_VARS)){ extract($HTTP_GET_VARS); }
 
//  Extract POST  //
if(!empty($_POST)) { extract($_POST); }
elseif(!empty($HTTP_POST_VARS)) { extract($HTTP_POST_VARS); }
 
you should seriously consider recoding your project to use $_GET and $_POST, instead of relying on this, however.

Re: urgently help needed : php script not working.!

Posted: Tue Feb 12, 2008 10:16 am
by Zoxive
mapperkids wrote:how to turn it on?

put in .htaccess file?

thanks
Temp Fix:

.htaccess

Code: Select all

php_flag register_globals on

Re: urgently help needed : php script not working.!

Posted: Fri Feb 15, 2008 3:17 am
by ajay1kumar1
Please use
register_long_arrays = On
in your php.ini
Ajay

:banghead:

Re: urgently help needed : php script not working.!

Posted: Fri Feb 15, 2008 6:01 am
by markusn00b
ajay1kumar1 wrote:Please use
register_long_arrays = On
in your php.ini
Ajay

:banghead:
He/She may not have access to the php.ini file.

Re: urgently help needed : php script not working.!

Posted: Fri Feb 15, 2008 7:44 am
by ajay1kumar1
if can't access php.ini then you can use this in .htaccess
register_globals = On
register_long_arrays = On
register_argc_argv = On

Please reply here if you want something else

Regards
Ajay kumar singh :drunk: