I've been doing some testing with PHP sessions. I've got a page set up where if there is no session, it automatically redirects you to my homepage. However, it does that every time. I can't figure out how to send the set session from the form to that page in order to show it that it has been set. How would I do this?
<?php
session_start();
if(empty($_SESSION['foobar']) or $_SESSION['foobar'] != true)
{
header('Location: http://www.example.com/index.php');
exit;
}
// rest of page . . .
?>
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
((sorry for the double post; can't edit the last one at this point))
I was able to figure my last question out on my own. But for some reason, in the test page for the session, none of the CSS is working. What's up with that?
No way to tell without seeing it. Might be a good idea to start by running the page through the HTML validator and CSS Validator pages.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
That's the form page to create the session, and it's doing the same thing. I have the background color in the CSS set to #000000 (black). That stylesheet works on all of my other pages that I use it on, so I don't understand why it doesn't work on this one.
Is it in the same directory as the other files that work? I ask because you use a relative path to the CSS file in your link tag.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
It's not in the same directory as the form and session test page that I'm experimenting with. It's in my CSS directory (where I keep all of my stylesheets). To get to the pages I'm testing, you have to go to domain.com/news/page.php. The CSS directory is in the main site root.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks