Old 03-06-2009   #1 (permalink)
Registered User
 

Join Date: Mar 2009
Posts: 2

Question PHP/HTML Question. How to change frame after login?

I have a small login script written in PHP, everything in that regard is written. The Login is in one frame on top.

However, when the user logs in I want another frame to display a set of links only available to those logged in.

How can I do this?, Thanks!
jeena1 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-06-2009   #2 (permalink)
Registered User
 
U'ziel's Avatar
 

Join Date: Sep 2005
Posts: 88
Images: 1

Frames?? I wouldn't be using frames at all are you sure thats what you mean? do you know CSS?

Otherwise I would use a simple if statement to check that the user was logged in, if yes then echo the restricted content, if no do nothing. Are you using sessions to stay logged in between pages? If no set a session variable that you can pass between your pages without using the URL in your browser. That way its hidden and your code can detect if users are logged on when pages re-load. Your IF statement then just needs to check that the session variable has been set to show or hide the restricted content. Thats probably the easiest way, you could do the same thing using a cookie stored on the users computer but this is less secure. If you paste your code that would be helpful.
U'ziel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-06-2009   #3 (permalink)
Registered User
 
U'ziel's Avatar
 

Join Date: Sep 2005
Posts: 88
Images: 1

Login.php:
<?php
session_start(); // Starts the session

/* Your exisitng code to authenticate login here */

$_SESSION['user_id'] = 1; // Sets the session variable with a value of 1. You could generate a random string to add to 1

?>

Homepage:

if ($_SESSION['user_id'] == 1) {

echo "Restricted content";

} else {

}


Something like that.
U'ziel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-08-2009   #4 (permalink)
Registered User
 

Join Date: Apr 2009
Posts: 12

Quote:
Originally Posted by U'ziel View Post
Login.php:
<?php
session_start(); // Starts the session

/* Your exisitng code to authenticate login here */

$_SESSION['user_id'] = 1; // Sets the session variable with a value of 1. You could generate a random string to add to 1

?>

Homepage:

if ($_SESSION['user_id'] == 1) {

echo "Restricted content";

} else {

}


Something like that.
I have tried it this code is not working...
harish is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-18-2009   #5 (permalink)
Registered User
 
U'ziel's Avatar
 

Join Date: Sep 2005
Posts: 88
Images: 1

It's simplified psuedo code, to highlight the use of sessions in php with a quick example. It was never meant to be a working solution, most of the time i'm writing at work in my free time.

I suppose it would have been better to do a harish special though;


"Php sessions are good, I have used many times. You can learn more about sessions at this link:

http://uk.php.net/manual/en/function.session-start.php "

-----------------------------
Link to my paying affiliate site here.


..you are starting to grate on me.

Last edited by U'ziel; 04-18-2009 at 06:55 AM.
U'ziel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 1 Week Ago   #6 (permalink)
Registered User
 

Join Date: Mar 2009
Posts: 2

Thumbs up

Hello,
I was wondering if anybody here can help with a popular script
A Complete Membership System
I wanted to know how a forgotten password be added to this script and the remember me feature. Any help will be much apprecaited anybody can email me at kaise@hotmail.co.uk

Thank you.
kaise is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 1 Week Ago   #7 (permalink)
Registered User
 
ahstanford's Avatar
 
Simon Champion!
Join Date: Oct 2003
Location: Trenton, Georgia
Posts: 1,845
Images: 12

Send a message via AIM to ahstanford Send a message via MSN to ahstanford Send a message via Yahoo to ahstanford
@kaise: I think you might want to take a read.

Alex
__________________
I have <style> and .class, thank you!
deviantART | Facebook | LinkedIn | Twitter | SitePoint
Are you new to the forums? Read this!
ahstanford is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding HTML contents on frame load shinde_vishvana HTML / PHP / ASP / JS 2 10-18-2007 07:28 AM
HTML Question - PLEASE READ Neil_8_24_93 HTML / PHP / ASP / JS 6 08-13-2006 05:11 PM
PHP Login Help Space Cowboy HTML / PHP / ASP / JS 11 06-01-2005 10:02 AM
Login codeing Stiker HTML / PHP / ASP / JS 16 04-19-2004 01:23 PM


All times are GMT +1. The time now is 12:41 PM.

Powered by vBulletin Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT