2 Replies - 5971 Views - Last Post: 22 October 2009 - 07:34 AM Rate Topic: -----

#1 linking  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 22-October 09

Session variable not working on live server

Posted 22 October 2009 - 07:04 AM

my session variable is working in localhost but when same code is not run on live server i m pasting code i do require some hint
<?php
session_start();
require_once('conn.php');


if(isset($_SESSION['Uid']))
{
header('location:f5.php');
}
if(isset($_REQUEST['Submit']))
{
$ckcomm='select * from login_tb where Uname="'.$_REQUEST['textfield'].'" and Pass="'.$_REQUEST['textfield2'].'"';
$ckread=mysql_query($ckcomm);
if(!$ckread)
{
die('error in query');
}
$ckrw=mysql_fetch_array($ckread);
$nrw=mysql_num_rows($ckread);
if($nrw>0 and isset($_SESSION['Qid']))
{
$_SESSION['Uid']=$ckrw['Uid'];
$_SESSION['uname']=$ckrw['Uname'];
header('location:f5.php');
}
elseif($_SESSION['Qid']=="")
{
$_SESSION['uname']=$ckrw['Uname'];
$_SESSION['Uid']=$ckrw['Uid'];
header('location:f1.php');
}
else
{
?>
<script language="javascript">
alert('incorrect username or password');
</script>
<?php
}
}

?>

Is This A Good Question/Topic? 0
  • +

Replies To: Session variable not working on live server

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1003
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: Session variable not working on live server

Posted 22 October 2009 - 07:22 AM

First, could you use [code] tags!

Secondly, it's most likely an issue with the PHP Configuration (php.ini) on the live server. Make sure that the session directory is setup in php.ini, exists and is writable.

This post has been edited by RudiVisser: 22 October 2009 - 07:22 AM

Was This Post Helpful? 0
  • +
  • -

#3 linking  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 22-October 09

Re: Session variable not working on live server

Posted 22 October 2009 - 07:34 AM

View PostRudiVisser, on 22 Oct, 2009 - 06:22 AM, said:

First, could you use [code] tags!

Secondly, it's most likely an issue with the PHP Configuration (php.ini) on the live server. Make sure that the session directory is setup in php.ini, exists and is writable.



Thank you sir for your reply.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1