• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

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.
0
soffcec
Asked:
soffcec
2 Solutions
 
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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
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
 
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

Featured Post

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now