Page 1 of 1

switch works on localhost(windows 2000) but not on Linux

Posted: Sun Aug 10, 2003 1:03 am
by ckb
switch works on localhost, not webhost...

Hello all. I have problem with switch statement in version PHP 4.2.2 on linux

server. in my error page i am not getting the value of error code ec passed which is working perfectly on windows 2000.
That means echo $_GET['ec']; is empty ....
in the url i am getting the value of ec as 0...
like this


http://191.5.2.23/admin/ERROR.PHP?ec=0





pls help
thanx in advance
ckb

pls check part of my code:

<?php // these code used to diplay message if there is any Unathiora
include("connection.php");
// $ec=$_GET['ec'];
//switch($ec)
if(isset($_GET['ec']) ) {
switch($_GET['ec'])
{
case 0:

$message="<font color='black'><b>
Your user name or password is incorrect!
<a href=index.php>Please try again.</a></b></font>";
break;
case 1:
$message="<font color='darkgreen'><b>
There was an authentication error.
Please<a href=index.php>Log in </a>correctly.</b>";


}
}
?>

Posted: Sun Aug 10, 2003 4:43 am
by JAM
Try looking into this viewtopic.php?t=511. Sounds like a version collide.

reply

Posted: Sun Aug 10, 2003 10:58 pm
by ckb
hi JAM,


I read that topic.....accordingly only i tried ....
still no use.....
the main problem is i am not getting the value of $_GET['ec'] in the error page.

pls help
thanx in advance
ckb

Posted: Sun Aug 10, 2003 11:30 pm
by nielsene
What version of PHP is on the Linux machine. $_GET only exists in 4.1.x and higher. Try $HTTP_GET_VARS instead if its pre 4.1

reply

Posted: Sun Aug 10, 2003 11:45 pm
by ckb
hi all,


now it's working fine......it was php version 4.2.2 only and my code also was correct....but a small mistake....i saved my file as ERROR.PHP IT WAS THE CAUSE OF MY PBM.....since it was linux it is not recognising my php file at all when i saved in capital letter....now everything i s ok..... :D


thanx a ot for all....
ckb