I have a php program that works fine on my localhost, but when i upload it to my active website, it doesn't work properly.

The main issue is that it doesn't keep track of a logged in member as it should. For example, after a member logs in, he can access his account information, but if he moves around the site, his record pointer somehow gets lost, so he is no longer associated with his account.

Remember, this doesn't happen on my localhost. I use two $_SESSION[] variables to keep the record pointer on the logged in member as he moves around the site.

Can anyone tell me why that pointer is being lost on the active website and not the localhost?

Below is a section of what i consider to be the relevant code:

	if($_SESSION['userlog']!="")
	{
		$id=$_SESSION['memid'];
        $loginid=$_SESSION['loginid'];
        $yrEnt=substr($id,0,4);
        $mId=substr($id,5,4) ;
        $sql="SELECT * FROM `membdetail` WHERE `mem_entersch` = '".$yrEnt."' AND `mem_id` =".$mId." AND `mem_logid` ='".$loginid."' ";
		$result=mysql_query($sql);
		$row=mysql_fetch_array($result);

	$id=$row["mem_logid"];
	$name=$row["mem_prefix"]." ".$row["mem_fname"]." ".$row["mem_lname"];
    $reg_no=$_SESSION['memid'] ;
	$sch_relation=$row["mem_relation_to_sch"];

    If session_autostart is not enabled in the live server's php.ini, you'll have to call session_start() on every page you want the session available in.

    Compare the live server php.ini with your local php.ini. Try to mimic (as best you can) the live server in your development environment. This really tends to cut down on this type of issue.

      Thank you ... your logic worked. However, the key was not the session_autostart() that was the same on both files.

      I think it had to do with the mysql section i have listed below in the quotes. These variables were not present in the server file:

      [MSSQL]
      ; Allow or prevent persistent links.
      mssql.allow_persistent = On

      ; Maximum number of persistent links. -1 means no limit.
      mssql.max_persistent = -1

      ; Maximum number of links (persistent+non persistent). -1 means no limit.
      mssql.max_links = -1

      ; Minimum error severity to display.
      mssql.min_error_severity = 10

      ; Minimum message severity to display.
      mssql.min_message_severity = 10

      ; Compatibility mode with old versions of PHP 3.0.
      mssql.compatability_mode = Off

      ; Connect timeout
      ;mssql.connect_timeout = 5

      ; Query timeout
      ;mssql.timeout = 60

      ; Valid range 0 - 2147483647. Default = 4096.
      ;mssql.textlimit = 4096

      ; Valid range 0 - 2147483647. Default = 4096.
      ;mssql.textsize = 4096

      ; Limits the number of records in each batch. 0 = all records in one batch.
      ;mssql.batchsize = 0

      ; Specify how datetime and datetim4 columns are returned
      ; On => Returns data converted to SQL server settings
      ; Off => Returns values as YYYY-MM-DD hh:mm:ss
      ;mssql.datetimeconvert = On

      ; Use NT authentication when connecting to the server
      mssql.secure_connection = Off

      ; Specify max number of processes. -1 = library default
      ; msdlib defaults to 25
      ; FreeTDS defaults to 4096
      ;mssql.max_procs = -1

      ; Specify client character set.
      ; If empty or not set the client charset from freetds.comf is used
      ; This is only used when compiled with FreeTDS
      ;mssql.charset = "ISO-8859-1"

      [Assertion]
      assert.active = 1
      assert.warning = 1
      assert.bail =
      assert.callback =
      assert.quiet_eval = 0
      [Sockets]
      sockets.use_system_read = 1

        Write a Reply...