hii , i have this custom made php script seems to be not letting me in ( login ) , it seems to work fine on other server though. wondering what could be wrong ?? it has php 5 (@ mediatemple ) . db config is all fine . this is the login code #### <?php session_start(); if(empty($action)) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/> <title>Login</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> <div id="header"> <h1><a href="#">blah</a></h1> <ul id="menu"> <li><a href="index.php">Home</a></li> <li><a href="login.php">Projects</a></li> <li><a href="logout.php">Logout</a></li> </ul> </div> <div id="loginbox" align=center> <table width="400" align=center border="0" cellpadding="0" cellspacing="0" > <tr> <td colspan="2" valign=top id="logintop"><font color=white>Login</font></td> </tr> <tr> <td colspan="2" > </td> </tr> <form action="login.php" method="post"> <input type="hidden" name="action" value="check"> <input type="hidden" name="id" value="<?php echo $id; ?>"> <tr> <td width="137" align="left"><b> E-mail:</b></td> <td width="263"><input name="email" type="text" size =35></td> </tr> <tr> <td width="137" align="left"> </td> <td width="263"> </td> </tr> <tr> <td align="left"><b> Password: </b></td> <td><input name="password" type="password" size=35></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" align="right"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" align="right"> <input type="image" src="images/login_07.jpg" > </td> </tr> <tr> <td colspan="2" align="right"> </td> </tr> <tr> <td align="left"> </td> <td align="right"><input name="rememberme" type="checkbox" value="1"> Remember me </td> </tr> </form> <tr> <td colspan="2" align=left> </td> </tr> </table> </div> <? include("footer.php"); } else { include("db.php"); $lekerdez = mysql_query("select * from project_users where email='$email' and password='$password'"); if(mysql_num_rows($lekerdez) > 0) { $sor = mysql_fetch_array($lekerdez); $_SESSION["uid"] = $sor["id"]; $_SESSION["gid"] = $sor["group_id"]; $_SESSION["level"] = $sor["level"]; } mysql_free_result($lekerdez); mysql_close($link); if(empty($id)) { Header("Location: index.php"); } else { Header("Location: job_details.php?id=$id"); } } ?> PHP:
ok i figured out the solution ( i hope) it was a issue with PHP Sessions , going to try it now configuring a directive inside of a custom php.ini file to explicitly direct session files to save in a local directory on your (gs) Grid-Service instead of the default global '/tmp' folder. This directive must be placed inside of your php.ini file on the very last line of the file: session.save_path = /home/####/data/tmp Where '####' is your actual site number. so, for s1234.gridserver.com, you would use the following: session.save_path = /home/1234/data/tmp
It's probably a register_globals issue. Replace empty($action) PHP: With empty($_REQUEST['action']) PHP: And $email with $_POST['email'], and $password with $_POST['password'], and $id with $_REQUEST['id']. www.php.net/register_globals