Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 23rd, 2011, 09:10 AM
Authorized User
 
Join Date: Jul 2011
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default regarding php session

tell me how to do
1)check session is present or not
2)until there is a session then it must redirect to page "products.php"
3)if there is no session also create one session and then redirect to the
page "products.php"
 
Old October 16th, 2011, 07:19 AM
Authorized User
 
Join Date: May 2010
Posts: 70
Thanks: 4
Thanked 6 Times in 6 Posts
Send a message via Yahoo to GeneBuchite
Default php session

remember to start each page using sessions at the TOP of the page with
Code:
<?php session_start(); ?>
Code:
 
if(!isset($_SESSION['id'])) {
 echo "no session started redirecting to login page";
 echo "<script> location='products.php'</script>";
 }





Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP session cookie ajit Beginning PHP 0 October 23rd, 2007 11:56 PM
PHP Session error anmolnandha Beginning PHP 1 November 29th, 2006 11:06 PM
Session Error in PHP Randhy MySQL 8 December 17th, 2004 07:49 AM
Php login session problem programmer Beginning PHP 1 August 3rd, 2004 03:57 AM
PHP Session passed to different sub domains h8dk97 Pro PHP 3 November 6th, 2003 10:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.