hi all,

i am facing a serious problem while trying to make my site live which contains PHP pages. The pages which is working perfectly fine in localhost and intranet is not working when i put it in live. The problem is when i pass data between pages i am not getting anything in the where condition of query. I used HTTP_POST_VARS & HTTP_GET_VARS in proper places. database connection also correct as i can able to display information on the page from it. Main problem in my search page and login pages. When i search i won't get anything even when data is there. Also i am not able to login with a username and password ....Important thing to be noted is that everything is working fine in localhost.Anyone can help me....
Thanks in advance...
ckb

    Hi,
    try to make a file with only <?phpinfo()?>
    and run it on localhost and remote.

    It return information that are usefull to debug this problem...

    see you

      hi,

      i checked phpinfo.php in localhost and remote host. and in the connection file i used remote_addr as host name . but now i am not even getting connection to the database which is ok earlier...
      can u tell me why it happens?
      thanks ,
      ckb

        You need to either post code that details teh problem, or explain better what exactly the problem is. There are litterally a million things that could cause this behavior.

          5 days later

          hi,

          I guess the problem of my PHP pages like login & search etc which is

          working fine in localhost but not giving the required output with live

          data is something had gone wrong in passing session id in live. For eg

          i am registering session in login script and in the next page i am

          using session_start to start the session and here session id is coming

          empty. so all my checkings with session giving no output also no error.
          Is it because somethig wrong in the session save_path . in my localhost

          i just created a directory tmp in C and put session things there.
          But in live session.save_path is set to C:\PHP\sessiondata . So the

          problem of not getting session id passed is because in server forgot to

          create the folder C:\PHP\sessiondata ....Otherwise what could be the

          problem ...can anyone help me...
          thanks in advance...
          ckb

            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

              hi ,
              I don't think my problem is because of cookie. I will explain again my pbm . Just suppose first time i am trying to login as user "test" from first.php page. that time i will get session id empty in my second page second.php. then without closing the page i will come back to first.php and refresh it. Then i tried to login using another user name "rani". so that time i am getting session id of that user in second page second.php and all required informations...now i am not able to find out the cause of this problem....pls help me..
              expecting immediate reply as i am unable to make web site live because of these pbms..
              thanx in advance..

              ckb

                Write a Reply...