when I execute both of the script by using browser ("http://localhost/Input.php" then "http://localhost/Output.php" ) its work according to the code. But when I execute it with command prompt ("php Input.php" then "php Output.php") then is gave output
Undefined index: var in /usr/local/apache2/htdocs/Output.php
I searched for this problem and found that session_start() is not work with command prompt. Can you please tell me the solution for that.
I doubt it will work via the command line like that, since it would depend on the command line interface to pass in the session ID cookie. You would need some way for the first script to pass the session ID to you, so that you could add it as a command line argument in the second script and apply it, allowing session_start() to know which session data file to open.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I found the solution of my problem, due to different session id command line and browser unable to communicate with each other. If there is any way to send session id to my client script and my client script run by using that session id.
thanks for your support, I have used server session_id and pass it to only one script that I executed through browser. After that All the script run by using that id only. But every time when I start the server it session id will change and I have to configure that id with that script. This problem I will manage but the main problem is that when I used while(1) in my server script it run according to the code inside the loop on server side console but, when I access the data from client script that time client script is in wait mode until the server script is not terminate. This is very big problem that I have faced after all this struggle.