Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #1297

Re: php sessions and css file?

From sheldonlg <sheldonlg@thevillages.net>
Newsgroups comp.lang.php
Subject Re: php sessions and css file?
Date 2011-04-26 15:29 -0400
Organization A noiseless patient Spider
Message-ID <ip76e1$nfi$1@dont-email.me> (permalink)
References <77c2d91e-a1ca-4aed-aa76-f1ee0f67701e@k11g2000yqc.googlegroups.com> <b651fd8a-5fbc-4c50-ae9d-07c68c1e2a45@d2g2000yqn.googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

php sessions and css file? Alex Pavluck <apavluck@gmail.com> - 2011-04-26 07:46 -0700
  Re: php sessions and css file? Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-04-26 17:03 +0200
  Re: php sessions and css file? sheldonlg <sheldonlg@thevillages.net> - 2011-04-26 11:09 -0400
  Re: php sessions and css file? Alex Pavluck <apavluck@gmail.com> - 2011-04-26 10:08 -0700
    Re: php sessions and css file? Jerry Stuckle <jstucklex@attglobal.net> - 2011-04-26 13:50 -0400
    Re: php sessions and css file? sheldonlg <sheldonlg@thevillages.net> - 2011-04-26 15:29 -0400
      Re: php sessions and css file? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-04-28 02:24 +0200
        Re: php sessions and css file? sheldonlg <sheldonlg@thevillages.net> - 2011-04-27 20:30 -0400
          Re: php sessions and css file? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-04-28 21:15 +0200
  Re: php sessions and css file? Alex Pavluck <apavluck@gmail.com> - 2011-04-26 12:53 -0700
    Re: php sessions and css file? sheldonlg <sheldonlg@thevillages.net> - 2011-04-26 16:05 -0400
    Re: php sessions and css file? Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-04-27 07:58 +0200

csiph-web