hi all,
now i understood that the problem was in the session save _path in the
server...Also the version difference...in live php version is 4.3.1
and i got the scripts which is working fine in php version 4.0.5. So
PHP crashes when comes to session handling.but again i have problem
here. even after using $_SESSION Session id is not passing properly so
my script fails..my code is below:
in the first page i registered the session variable using $_SESSION and
i am passing it to the next page .there i call session_start() to
start the session and use the select script.
few lines of code in firstpage ...
if(!session_is_registered("SESSION_UID"))
{
session_start();
$ipa=$REMOTE_ADDR;
$todaydate=date('Ymd');
$todaytime=date('his',mktime());
//declare variable for the sessions
//session_register("SESSION_UID");
$_SESSION['SESSION_UID'];
// open connection to database
$connection=mysql_connect($hostname,$user,$pass)
or die("Unable to connect to the database");
//global $HTTP_POST_VARS;
$a=$_POST['email'];
$b=$_POST['userpass'];
// echo $a;
// echo $b;
//validate the userName and password which has been entered by the user
// $query="select email,user_pass from user
// where email='$email' AND user_pass=PASSWORD('$userpass')";
$query="select email,user_pass from user_log
where email='$a' AND user_pass=PASSWORD('$b')";
// echo $query;
//Store the result in variable
$result=mysql_db_query($database,$query,$connection)
or die("Error in query:$query." .mysql_error());
//if the username and password match a record do the following
if (mysql_num_rows($result)==1)
{
//a sign values to the variables
list($email,$userpass)= mysql_fetch_row($result);
// $SESSION_UID=$email;
$_SESSION['SESSION_UID']=$email;
//echo "session id is ". $SESSION_UID;
$se=$_SESSION['SESSION_UID'];
{
header("LOCATION:moh_updateper1.php?$se");
}
then in second page i use like this:
<?php
session_start();
$todayyear=date('Y');
echo "sessionid from the previous page is ". $se;
echo "<br>";
//connection
//after that
$query="SELECT applicant_id,name from test where email='$_SESSION['SESSION_UID']'";
Here i am getting $_SESSION['SESSION_UID'] empty when i execute the script...what could be the reason???pls help...
Also i am having problem in update ,insert scripts which is working very fine in php v 4.0.5.
expecting immediate reply
thanks in advance
ckb