Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 60 Time: 04:30 - Feb 19, 2007  

dustPuppy

$http_get_vars in php not working after host change?

I have changed hosting provider and now the $http_get_vars doesn't work any more in php? Could this be because of a different php version?
And what would the best alternative be?

Categories

Answer Discussion
Tutorials

 

jgivoni

Date:: Feb 19, 2007

Time:: 07:59

In PHP 4.1.0 the superglobal $_GET array was introduced.
$http_get_vars should still be available though - but maybe there is a setting in php.ini that configures how this variable can be accessed. Anyway, just use $_GET from now on - it's the official way ;-)

dustPuppy

Date:: Feb 19, 2007

Time:: 08:02

thank, jgivoni.
I'll use $_GET from now on.
I found out that the change was the new host not having Register Globals enabled default.

pankajsiddhast

Date:: Jun 05, 2007

Time:: 22:24

change your php.ini file

register_long_arrays = On

Or
********************
insert into your .htaccess file

register_long_arrays = On

*****************

and Enjoy with your nice codding

Question Answered

This question has been closed, and points have been rewarded to the following experts:


jgivoni: 30
dustPuppy: 30

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

jgivoni

Date:: Jan 06, 2009

Time:: 03:45

In PHP 4.1.0 the superglobal $_GET array was introduced.
$_GET officially replaces $http_get_vars.
$http_get_vars is still available if the directive "register_long_arrays" is enabled.

Read more:
http://www.php.net/manual/en/reserved.va...
http://www.php.net/manual/en/ini.core.ph...

If you are used to having the url query string parameters automatically accessible as variables in your script it is because the PHP directive "register_globals" is enabled. Another host might have this directive disabled (strongly recommended to avoid exploitations) and therefore any script that relies on "register_globals" will fail.

Read more here:
http://www.php.net/register_globals

Best regards,
Jakob


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

andy

Date:: Mar 02, 2009

Time:: 05:53

The current version of PHP does not support HTTP_GET_VARS[] by default where version 4 did. This means you've switched to a host using a more up to date version which is good (for security and hacking reasons).
Since you are using a host I guess you don't have the option ot switch these deprectated (obsolete) commands on for your server so you'll need to change your scripts.

I've just done this using search and replace in a text editor, replacing all instances of $HTTP_GET_VARS with $_GET and $HTTP_SERVER with $_SERVER. working a treat now.

Best of luck.

Andy


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

paws700

Date:: Sep 07, 2009

Time:: 07:50

Andy thank you sooo much for taking the time to post your response. This was driving me crazy, your answer worked like a charm


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es