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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ckb
Forum Newbie
Posts: 5
Joined: Sun Aug 10, 2003 1:03 am

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

Post 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>";


}
}
?>
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Try looking into this viewtopic.php?t=511. Sounds like a version collide.
ckb
Forum Newbie
Posts: 5
Joined: Sun Aug 10, 2003 1:03 am

reply

Post 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
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post 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
ckb
Forum Newbie
Posts: 5
Joined: Sun Aug 10, 2003 1:03 am

reply

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