Session
Posted on
16th Feb 2014 07:03 pm by
admin
I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not have any trouble logging into forums such at these, so not sure why this is not working.
first the code. Just basic code from php documentation plus some added checks.
Code: <?php
// page1.php
if (session_start()) {
echo "OK";
} else {
echo "FAIL";
}
// echo phpinfo();
// echo getcwd();
echo 'Welcome to page #1';
$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();
print_r($_SESSION);
// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';
// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>
And
Code: <?php
// page2.php
session_start();
echo 'Welcome to page #2<br />';
echo $_SESSION['favcolor']; // green
echo $_SESSION['animal']; // cat
echo date('Y m d H:i:s', $_SESSION['time']);
print_r($_SESSION);
// You may want to use SID here, like we did in page1.php
echo '<br /><a href="page1.php">page 1</a>';
?>
There is no reason why this should not work. Can someone go to:
http://www.e-sullivan.com/DIITop25/page1.php
and tell me if it works for you? It shows me that the sessions are being started but the variables are not passing between page1.php and page2.php for me.
No comments posted yet
Your Answer:
Login to answer
331
8
Other forums
what are '%S%', '%E%'
for example when i see Code: [Select]printf("Hello %srn", $name);
what does %s means
Changing files over
Just thought I'd start with the new forums looking really nice .
Ok basically I've made this
Why Are These Functions Causing MASSIVE Memory Problems? Please Help!
Hi,
I have a script with some options.
I use regex to replace patterns in strings, but
Showing selected item at top of list
Hi,
I've got a list of names which i am fetching from database like this:
$qry = db_query
Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn
Ten Operator Syntax
Hi Guys,
I can't figure out why i am getting a parse error with this basic ten op code:
Google Wave
So... has anyone used it yet? Is it any good?
http://wave.google.com/help/wave/about.html#vid
query based on 2 conditions
I want to select if the doc_type is either s OR f but this doesn't work:
Code: [Select]$query
Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming
[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.
If the program exits normally the por