Hello Everyone, I am posting this thread to get your help in PHP. I am using PHP with apache server but the problem is when I am trying to run a session program it does not show any results but creates an error log. Please help me to resolve this problem. The program is as: <?php session_start(); ?><html><head><title>First Session</title> </head> <body><?php if(!isset($_SESSION["tracker"])) { $tracker = 0; session_register("tracker"); } $_SESSION["tracker"]++; print("<br /><br />Tracker = " . $_SESSION["tracker"] . "<br />"); print("session_id =" . session_id() . "<br />"); ?> </body> </html><? Is there any fault with program or any other problem? Please help me to solve this.
you shouldnt use session_register() try this code <?php session_start(); ?><html><head><title>First Session</title> </head> <body><?php if(!isset($_SESSION["tracker"])) { $_SESSION["tracker"] = 0 } $_SESSION["tracker"]++; print("<br /><br />Tracker = " . $_SESSION["tracker"] . "<br />"); print("session_id =" . session_id() . "<br />"); ?> </body> </html>?> PHP:
Hello Sir, I tried both of your suggestion sbut error log is again created. Please show me way to solve this problem. Thank You
I ran the code and got te following results: Tracker = 1 session_id =08aac6adb0fa306915c699124b786f10 no error
Hello Sir, Thanks for your response. I am using: Windows 2000 proffessional Apache Server MYSQL PHP Please tell me how many things to go during configuring PHP with apache because I think I am making a mistake in this part. Please help me to fight this problem. Thank You
To check if php is working on your server create a file info.php and put this in the file: <?php phpinfo(); ?> Save the file on your server root and in the browser address line type "localhost/info.php". If Apache and PHP are ok you will see the systems variables