hi all,
i have a login page and a couple of other php pages. what i want is that nobody should be able to view my other php pages without logging in. i have tried with sessions but sadly session is not working with me. can anybody tell me of other ways to do it?
thanks in advance
carobee
0
Posting Whiz in Training
Recommended Answers
Jump to Posthi all,
i have a login page and a couple of other php pages. what i want is that nobody should be able to view my other php pages without logging in. i have tried with sessions but sadly session is not working with me. can anybody tell me of …
Jump to Postplease post your code with the session thing so we can edit it to make it work.
Jump to Postwhat you could do is setup your site so it asks for BASIC authentication as soon as you visit the site, and set a flag (marker) in a mysql table to show that they are logged in so the user doesnt get asked for a login everytime they visit a …
Jump to PostTry out a simple example.
<?php session_start(); $_SESSION['name']="something"; echo $_SESSION['name']; ?>
Tellme if that works.
Jump to PostHow bout another simple example.
<?php //page1.php session_start(); $_SESSION['name']="something"; echo $_SESSION['name']; header("location: page2.php"); ?> <?php //page2.php session_start(); echo $_SESSION['name']; ?>
Does this work ?
All 25 Replies
kalyankalyan
0
Newbie Poster
carobee
0
Posting Whiz in Training
ryan_vietnow
13
Posting Pro
Auzzie
6
Junior Poster
carobee
0
Posting Whiz in Training
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
carobee
0
Posting Whiz in Training
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
carobee
0
Posting Whiz in Training
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
carobee
0
Posting Whiz in Training
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
carobee
0
Posting Whiz in Training
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
carobee
0
Posting Whiz in Training
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
carobee
0
Posting Whiz in Training
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
carobee
0
Posting Whiz in Training
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
carobee
0
Posting Whiz in Training
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.