i thought define session was same as set cookies.
unfortunatelly after i define session, i can get the session variable on same page, but after post to other page, it can't get back the sesson variable.
anyone can help me ???
4 posting session variable to another page but still can get the variable like cookie.
after post other page, can't get session
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
thank to all..
after i add session_start() for each page, it was can be function already.
But the PC didn't accept cookie 1, and didn't accept session also. i just so blur for it. Other PCs was work correctly.
The sample coding ....
session.php
session1.php
after i add session_start() for each page, it was can be function already.
But the PC didn't accept cookie 1, and didn't accept session also. i just so blur for it. Other PCs was work correctly.
The sample coding ....
session.php
Code: Select all
<?php
session_start();
session_register('username') ;
?>
<html>
<body>
<?php
if (isset($posted))
$username = $posted ;
if (isset($username))
{
print("<P>we know u are $username ") ;
}
else
print("<P>we know u are $username ") ;
?>
<form action = "session.php" name="form1" method="post" >
<p>
<input type="text" name="posted">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
<a href="session1.php">to session1 </a></p>
</form>
</body>
</html>Code: Select all
<?
session_start();
?>
<html>
<body>
<?php
if (isset($username))
{
print("<P>we know u are $username ") ;
}
?>
<a href="session.php">go back</a>
</body>
</html>- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
That code relies on register_globals being on - could that be the problem?
Have you had a look at:
Before Post Read: Sessions with a Minor in User Logins
Mac
Have you had a look at:
Before Post Read: Sessions with a Minor in User Logins
Mac
thankx reply .. and ur guideline also..
the url u give, i read through already and try the sample also.
Before Post Read: Sessions with a Minor in User Logins
But the PC can't accept cookie 1, still can not function in local server. But function in the devnetwork.net/session/
i think maybe is my domain problem. b'cos when using IP such as
192.168.0.66/page1.php, it was function but use domain such as
valen_server/page1.php, it still can not function.
is it the php.ini or apache setting problem ? anything i need to changing?
register_globals was on already.
the url u give, i read through already and try the sample also.
Before Post Read: Sessions with a Minor in User Logins
But the PC can't accept cookie 1, still can not function in local server. But function in the devnetwork.net/session/
i think maybe is my domain problem. b'cos when using IP such as
192.168.0.66/page1.php, it was function but use domain such as
valen_server/page1.php, it still can not function.
is it the php.ini or apache setting problem ? anything i need to changing?
register_globals was on already.