Pass Variables in PHP

After I moved my website from Windows 2003 to 201R2 server I can no longer pass php variables as before.

Before I could do http://web.dot?variable=text
In php, echo "$variable"

But on the new server I need to do echo $_get['variable'] and it does not always work.
soffcecManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Just doing

echo "$variable"

would never have worked

You need to use $_GET['variable_name']

Notice the case is uppercase.
0
soffcecManagerAuthor Commented:
But on the older server I only did need to do echo "$variable" and have done so for years and can still do on the older server. I will need to rewrite all my stuff if this is not going to work.
Following code gives the same result on the old server but only $_GET works on the new one.
<?
echo "$br";
echo $_GET['br'];
?>
0
GaryCommented:
What PHP version is running on the old server? First time I've come across this!
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

soffcecManagerAuthor Commented:
They have the sam version PHP Version 5.3.28


http://o.tsc.is/php.php
http://n.tsc.is/php.php
0
Dan CraciunIT ConsultantCommented:
You had "register_globals" set to on/enabled on the old server. This is a serious security risk so on modern versions of PHP this is disabled by default.

Look for register_globals in php.ini and see if you can enable it. I would advise against it.

LE: you can see the difference in the php info pages from your links. On one server register_globals is on, on the other it's off.

HTH,
Dan
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GaryCommented:
@Dan - Good catch
modern versions of PHP this is disabled by default
Completely removed.
0
soffcecManagerAuthor Commented:
Yes , was just reading. I will consider this, but I have been running register_globals = on since 2003, and never had problem, but maybe I will have one tomorrow. We never know.
0
Dave BaldwinFixer of ProblemsCommented:
If you read the link that Gary provided, you won't have a problem 'tomorrow' because starting in PHP 5.4, there will not be any 'register_globals'.
0
Ray PaseurCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.