Page 1 of 1

External variables not working after migration to Linux

Posted: Wed Sep 08, 2004 9:04 am
by mikeb
Hi,

One of my client's migrated the site we built for them to a Linux box (they are hosting their own site in-house). After the move (they would have set up LAMP) our GET variables are not being seen. I've ssh'd onto the server and looked at their php.ini file. Register_globals is set to 'off'. I've created two pages to test the theory. They won't run on the client's server but will run on my 'nix box

Here are the two simple pages:

Code: Select all

<html>
<head>
<title>What's wrong with the Get variables?</title>
<body>

click <a href="test_out.php?message=<? echo "Hello"; ?>">here</a> to send message!

</body>
</html>

Code: Select all

<html><head><title>did it work?</title></head>
<body>

the message today is, <?print $_GETї'message'];?>

</body>
</html>
Any insight appreciated,

cheers,

Mike

Posted: Wed Sep 08, 2004 9:09 am
by redmonkey
You sample code assumes that 'short_open_tag' is set to on. Is this the case within your clients php.ini file?

Posted: Wed Sep 08, 2004 9:32 am
by mikeb
Had a look at the php.ini (on the client's machine)

Code: Select all

; Allow the <? tag.  Otherwise, only <?php and <script> tags are recognized.
short_open_tag = On
Should I change my tags to long tags in my code?

cheers,

Mike

Posted: Wed Sep 08, 2004 9:59 am
by redmonkey
If the 'short_open_tag' directive is set to 'On' then you should have no need to switch to the long opening tag. Having said that, I always use the longer opening tag as I consider it to be more protable than using the short open tag.

Can you tell me, in your first example (test_in.php) is the 'message' variable being set with 'Hello' when you view the link properties? or is it just the GET variables that are not being picked up by the 'test_out.php' script?

Posted: Wed Sep 08, 2004 1:10 pm
by feyd
I'm wondering what PHP version this LAMP installed..

Posted: Thu Sep 09, 2004 3:52 am
by mikeb
redmonkey
I always use the longer opening tag as I consider it to be more protable than using the short open tag
I think I'll move over to that idea anyway for future reference
is the 'message' variable being set with 'Hello'
Yes. I can see it in the status bar when I hover over the link and it remains in the address bar when I'm on the receiving page. To confirm, it is the GET variables which are not working (i.e. the variable is definitely going over to the receiving page).

feyd
what PHP version this LAMP installed
phpinfo reports version 4.6.0

thanks folks,

Mike

Posted: Thu Sep 09, 2004 4:20 am
by feyd
4.6.0 my eye.. 4.3.6 maybe.. :?

Posted: Thu Sep 09, 2004 4:30 am
by mikeb
DOH!

4.0.6

:oops:

Posted: Thu Sep 09, 2004 4:33 am
by feyd
that's ancient. update it now. :D