urgently help needed : php script not working.!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mapperkids
Forum Newbie
Posts: 15
Joined: Mon Feb 11, 2008 8:53 pm

urgently help needed : php script not working.!

Post 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 !
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

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

Post by Benjamin »

Register globals are turned off on your new server.
mapperkids
Forum Newbie
Posts: 15
Joined: Mon Feb 11, 2008 8:53 pm

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

Post by mapperkids »

how to turn it on?

put in .htaccess file?

thanks
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

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

Post 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.
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

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

Post 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
User avatar
ajay1kumar1
Forum Newbie
Posts: 2
Joined: Fri Feb 15, 2008 3:14 am

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

Post by ajay1kumar1 »

Please use
register_long_arrays = On
in your php.ini
Ajay

:banghead:
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

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

Post 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.
User avatar
ajay1kumar1
Forum Newbie
Posts: 2
Joined: Fri Feb 15, 2008 3:14 am

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

Post 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:
Post Reply