nicx Posted June 20, 2008 Share Posted June 20, 2008 Master! Plz help me to make a session for my page,coz i was try but that not perfect. I have 2 page,they are page1.php and page2.php. I want to connect page1 and page2 with session. So,user who enter page2 he can't enter that page before,he through page1.php. And if he enter page1.php he get session to enter page2.php.And that session expire in 20minutes, How with session sintax?? And i wan't the url in page2.php become domain.com/page2.php?sid=xxxx because session i'm create can't show url like that. Plz help with the sintax.Thanks Link to comment https://forums.phpfreaks.com/topic/111052-how-to-make-a-simple-session/ Share on other sites More sharing options...
cooldude832 Posted June 20, 2008 Share Posted June 20, 2008 page1.php <?php session_start(); $_SESSION['Start'] = 1; ?> page2.php <?php session_start(); if($_SESSION['Start'] != 1){ echo "You ain't suppose to be here"; } else{ #display page } ?> Link to comment https://forums.phpfreaks.com/topic/111052-how-to-make-a-simple-session/#findComment-569867 Share on other sites More sharing options...
bluejay002 Posted June 20, 2008 Share Posted June 20, 2008 Also, there's a lot of results when you try searchin' in Google. . a few minutes would do. Link to comment https://forums.phpfreaks.com/topic/111052-how-to-make-a-simple-session/#findComment-569875 Share on other sites More sharing options...
nicx Posted June 20, 2008 Author Share Posted June 20, 2008 page1.php <?php session_start(); $_SESSION['Start'] = 1; ?> page2.php <?php session_start(); if($_SESSION['Start'] != 1){ echo "You ain't suppose to be here"; } else{ #display page } ?> bro,how to write the link to connect page2 with <? echo "<a href=..."; ? ?> what i must add behind the original url and is the url shown on address bar become http://domain.com/page2.php?sid=xxxx...? Because i was make sid like that but that not show url like i want. How? Link to comment https://forums.phpfreaks.com/topic/111052-how-to-make-a-simple-session/#findComment-569949 Share on other sites More sharing options...
nicx Posted June 20, 2008 Author Share Posted June 20, 2008 Master,plz answer? Link to comment https://forums.phpfreaks.com/topic/111052-how-to-make-a-simple-session/#findComment-570627 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.