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 #173669 is a reply to message #173667] Tue, 26 April 2011 19:29 Go to previous messageGo to previous message
sheldonlg is currently offline  sheldonlg
Messages: 166
Registered: September 2010
Karma:
Senior Member
On 4/26/2011 1:08 PM, Alex Pavluck wrote:
> Thanks for the comments. I guess I didn't explain my problem well.
> The issue is in the protect.php file if I take the code and cut out
> only the html and paste it into works.html then the css file works.
> If I either name the file php then the css doesn't work.

You still didn't explain it well. What I _THINK_ you are saying is:
(a) if you remove the <?php ... ?> from protect.php and run
protect.php, then it doesn't show the effect of layout.css

and

(b) If you then rename that file that no longer contains php and call it
works.html then it does show the effects of layout.css.

Is that what you are saying? If you are, then it makes no sense since
file names are irrelevant (can be either htm, html or php).

>
>
> On Apr 26, 10:46 am, Alex Pavluck<apavl...@gmail.com> wrote:
>> Is it possible to use a css file if you are using php sessions to
>> login?
>>
>> 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!
>>
>> protect.php
>> <?php
>> session_start();
>> // Call this function so your page

There is no "function" being called here

>> // can access session variables
>> if($_SESSION['loggedin'] != 1) {

You indentation is improper.

>> // 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>
>> ....
>
Does you source code from the BROWSER (the result -- view page source)
indicate items in the css for different elements? How is it being
improperly displayed?

--
Shelly
[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:36:52 GMT 2024

Total time taken to generate the page: 0.04767 seconds