FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php sessions and css file?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php sessions and css file? [message #173665 is a reply to message #173664] Tue, 26 April 2011 15:03 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 4/26/2011 4:46 PM, Alex Pavluck wrote:
> Is it possible to use a css file if you are using php sessions to
> login?

Yes, they are completely different concepts.
So, unless you try to mix them somehow, they have nothing to do with
each other.


>
> Here is my code:
>
> valid.php
> ....
> if($count==1){
>
> $_SESSION['loggedin'] = 1;// Set session variable
> header("Location: protect.php");//header must be the first printed
> line!


Did you add an:
exit;
after that header?

>
> protect.php
> <?php
> session_start();
> // Call this function so your page
> // can access session variables
> if($_SESSION['loggedin'] != 1) {
> // If the 'loggedin' session variable
> // is not equal to 1, then you must
> // not let the user see the page.
> // So, we'll redirect them to the
> // login page (login.php).
> header("Location: index.html");
> exit;
> }
> ?>
>
>
> <html>
> <head>
> <title>DOLF Project Log In</title>
> <link rel="stylesheet" type="text/css" href="layout.css"
> media="screen" />
>
> </head>
> <body>
> ....


You didn't describe your problem.

A wild suggestion: look into the source of the resulting webpage.
Possibly you will see a warning/notice that makes your HTML invalid
enough for the browser to ignore the css.

Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Adding a CDATA section
Next Topic: hai
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 15:49:36 GMT 2024

Total time taken to generate the page: 0.04223 seconds