FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP Sessions Issue





akshar
I have a following code
Code:

<?php session_start();?>
<html>
<head>
<script src="something.php" language =javascript></script>
........
<body>
<?php
$_SESSION['user']="hello";
?>
Code to refresh the page


in something.php which actually renders a javascript
Code:

<?
if($_SESSION['user')
{
echo "alert('valid')";
}
else
{
echo "alert('invalid');
}


on one machine I get promt as valid and on one machine I get it as invalid. Do u know the reason?
Peterssidan
You have forgot a ] at
Code:
if($_SESSION['user')
rvec
and you shouldn't forget the session_start(); on every page that uses sessions, not only the one on which it starts.

You should think of session_start(); as a command to start session handling, not a command to start a session.
akshar
well sorry for typo mistakes
however my problem got solved when i used meta tag fr disabling cache
Related topics
php sessions
PHP: Sessions and Cookies
PHP Sessions
php sessions
problems for indexing php pages in google.
PHP sessions and security
How to make a log in log out system for a website??
php sessions for different accounts
php SESSIONS question
php upload issue
php mkdir issue
friendster issue
PHP directory issue
PHP Session Timeout/Max Life Time
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.