over 5 years ago
My code working in my locahost wamp server. But if I uploaded it to my hosting server it's not working.
Please give solution. Or reason for this problem. Thanks
Here is my code :
$rand = rand(0,10);
$_SESSION['result'] = $rand;
echo "<form action='' method=GET><input type='hidden' name='submit' value='true'><input type='submit' value='GET IT'></form>";
echo "result not set in session";
If it worked normally it will do following :
Prints a random number. After i clicked "GET IT" It will print that number.
Hi, Thank You @narendra.arora and @sukhminder.kaur. Finally Found the Problem.
I changed 404 error page as index.php. Chrome is automatically requesting favicon.ico. But it's not in server. Therefore it responded with body of index.php. That is affected session....
Hi, If you moved the code from WAMP (windows) to a hosting server (Cpanel) I assume the basic problem that we see in this case is the file permissions.
Please set the file permissions to 0644 and then try to execute the page again.
If it still does not work please look into the error logs and post the messages you get.
Hope this helps.
session_autostart is off
session.save_path is c:\php55\sessiondata
If i did like this it's working. But it's not working above mentioned code
Can you check the session settings in your php.ini files. As you are using sessions, the values need to be defined correctly in php.ini file.
You can look for session_autostart which should be set to 0 and also the path where the session variables will be stored. You should have permissions to write to that folder.
Thanks for your answer. I think it's not a permission problem because I'm posting to same page & my other projects are working fine on that server which uses session. It's a windows 2012 server
It would really help us to sort your problem if you could post the output on error logs when you execute the code.
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Terms of Service
| © copyright 2021 FindNerd.com. All rights reserved.
Sign up using