GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Feb-2008, 20:25
skuliaxe skuliaxe is offline
New Member
 
Join Date: Jan 2008
Posts: 2
skuliaxe is on a distinguished road

Simple login reveals extra menu/buttons...


Hi, I´m trying to make a simple login script.
I have a page that only select people can have access to. There is no registration (I register them and add them to the database directly).

On my page, there are should be "hidden" menus and buttons that only members can access.
IF the user is not logged in (checked via cookie maybe) the login form should appear. Else (if user is logged in) the extra menus/buttons are showing.

php.about.com (login 1 and 2), but I get a header error! I just don´t know how headers work

I was just hoping to find a login script that:
1. Checks on each page if user is logged in
2. If logged in = show menu/buttons
3. If not logged in = show login form
4. Simple login form that adds cookie to users computer

A simple IF/ELSE could be used to show login or menu/buttons:
Like when a user is signed in, to show a button:
PHP Code:

PAGE HTML CODE... <?php if($logged_in == "Yes") {echo '<a href="some_page.php"><img src="icons/image_as_button.jpg" alt="" width="31" height="43" border="0" align="top" /></a>';} ...PAGE HTML CODE continues... 



I was hoping to do the same with the menus:
PHP Code:

HTML CODE... if($logged_in == "Yes") {echo 'HTML CODE FOR MENU HERE'; ...HTML CODE 



If user is not signed in (after IF statement):
PHP Code:

HTML CODE... else($logged_in == "NO") {echo 'HTML LOGIN FORM HERE'; ...HTML CODE 


.

Could anybody help me out?
  #2  
Old 15-Feb-2008, 13:44
Blake's Avatar
Blake Blake is offline
Member
 
Join Date: Nov 2005
Posts: 255
Blake is a jewel in the roughBlake is a jewel in the rough

Re: Simple login reveals extra menu/buttons...


http://www.tizag.com/phpT/phpsessions.php
__________________
www.blake-foster.com
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dediwebhost.com -- June Price Blowout - Celeron 2.4Ghz starts at $49 a month Dediwebhost.com Managed / Dedicated Servers 0 14-Jun-2007 13:35
Dediwebhost.com -- Dual Core Server Blowout. Must see to believe Dediwebhost.com Managed / Dedicated Servers 0 15-May-2007 12:51

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 08:17.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.