Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 118,873 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,832 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Login page

 
Reply to this topicStart new topic

Login page

sam_benne
post 15 Jul, 2008 - 07:55 AM
Post #1


D.I.C Head

Group Icon
Joined: 16 Jan, 2008
Posts: 245



Dream Kudos: 400
My Contributions


Hi on my website I have a login system and it works perfectly however, it is useless as it does nothing you can few every page and do what you want. I am no good at php but my whole site uses it and what I am after is a page a bit like myspace (not that complicated) and if a person logs in when they go on my forum they are allowed to add a topic. like on this website. So if there is anyone that knows of a good site that I can use or can help me please reply. Thank you in advance.
User is offlineProfile CardPM

Go to the top of the page


akozlik
post 15 Jul, 2008 - 09:43 AM
Post #2


D.I.C Addict

Group Icon
Joined: 25 Feb, 2008
Posts: 544



Thanked 20 times

Dream Kudos: 750
My Contributions


QUOTE(sam_benne @ 15 Jul, 2008 - 10:55 AM) *

Hi on my website I have a login system and it works perfectly however, it is useless as it does nothing you can few every page and do what you want. I am no good at php but my whole site uses it and what I am after is a page a bit like myspace (not that complicated) and if a person logs in when they go on my forum they are allowed to add a topic. like on this website. So if there is anyone that knows of a good site that I can use or can help me please reply. Thank you in advance.


I don't quite understand what you're asking, but I think you want to know how to lock out pages that require a login.

When your script sees that a login is successful, it should set a session variable to true.

php


if (loginSuccessful) {
$_SESSION['loggedIn'] = true;
}



Then on the top of every page you want authenticated, you would include something like

php


if ( ! $_SESSION['loggedIn'] ) {
// Redirect the user if he's not logged in
header("Location: login.php");
}



You could also put that script in a file like authenticate.php and just require() it.

Hope that's what you're looking for.

This post has been edited by akozlik: 15 Jul, 2008 - 09:43 AM
User is offlineProfile CardPM

Go to the top of the page

sam_benne
post 16 Jul, 2008 - 02:27 AM
Post #3


D.I.C Head

Group Icon
Joined: 16 Jan, 2008
Posts: 245



Dream Kudos: 400
My Contributions


Yes that is sort off what i was after but what i am also after is a profile page like the one we have on here but i have no idea how to do that.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/13/08 02:14AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month