nicx Posted June 23, 2008 Share Posted June 23, 2008 I have a session like this: 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 that show domain.com/page2.php?PHPSESID=xxxx. How? And how to sett session expired to 20minutes? Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/ Share on other sites More sharing options...
btherl Posted June 23, 2008 Share Posted June 23, 2008 Usually you should not need to add anything to the url. Do the scripts work if you don't add anything? Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572071 Share on other sites More sharing options...
nicx Posted June 23, 2008 Author Share Posted June 23, 2008 But that not work if i'm not add something after url.So,i can't enter page2.php if not add something after url. Plz help me with the sintax? Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572076 Share on other sites More sharing options...
btherl Posted June 23, 2008 Share Posted June 23, 2008 There's some examples here: <p> To continue, <a href="nextpage.php?<?php echo htmlspecialchars(SID); ?>">click here</a>. </p> Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572080 Share on other sites More sharing options...
nicx Posted June 23, 2008 Author Share Posted June 23, 2008 So,in page1.php i write <? echo "<a href=\"page2.php?htmlspecialchars(SID)\">click here</a>"; this right?? Ok,i will try it Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572231 Share on other sites More sharing options...
nicx Posted June 23, 2008 Author Share Posted June 23, 2008 So,in page1.php i write <? echo "<a href=\"page2.php?htmlspecialchars(SID)\">click here</a>"; this right?? Ok,i will try it Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572235 Share on other sites More sharing options...
nicx Posted June 23, 2008 Author Share Posted June 23, 2008 So,in page1.php i write <? echo "<a href=\"page2.php?htmlspecialchars(SID)\">click here</a>"; this right?? Ok,i will try it Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572239 Share on other sites More sharing options...
nicx Posted June 23, 2008 Author Share Posted June 23, 2008 So,in page1.php i write <? echo "<a href=\"page2.php?htmlspecialchars(SID)\">click here</a>"; this right?? Ok,i will try it Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572249 Share on other sites More sharing options...
btherl Posted June 24, 2008 Share Posted June 24, 2008 Can you try this: <? echo "<a href=\"page2.php?" . htmlspecialchars(SID). "\">click here</a>"; The "." separates the echoed strings and the call to htmlspecialchars(). Otherwise php will not understand the call. Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572756 Share on other sites More sharing options...
DarkWater Posted June 24, 2008 Share Posted June 24, 2008 Wow, I never thought I'd see a quadruple post with something other than "bump". O_O Crazy. Anyway, you shouldn't have to add that to the query string...it should just work. O_O Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-572758 Share on other sites More sharing options...
nicx Posted June 25, 2008 Author Share Posted June 25, 2008 Ok! Thanks master Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-573820 Share on other sites More sharing options...
nicx Posted June 25, 2008 Author Share Posted June 25, 2008 Ok! Thanks master Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-573821 Share on other sites More sharing options...
nicx Posted June 25, 2008 Author Share Posted June 25, 2008 Ok! Thanks master Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-573824 Share on other sites More sharing options...
DarkWater Posted June 25, 2008 Share Posted June 25, 2008 Is there a reason that you post the same thing over and over again? Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-573825 Share on other sites More sharing options...
LinuxForce Posted June 25, 2008 Share Posted June 25, 2008 http://us.php.net/session If anything id try taking a whack at this hoping this is what you are asking for Oh i think this has been solved also i think he may have had some lag while using the boards and just clicked it because it wouldn't load. Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-573834 Share on other sites More sharing options...
AlexMason Posted June 25, 2008 Share Posted June 25, 2008 <?php require('FILE.php') ?> That should work correct me if i'm wrong. Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-573869 Share on other sites More sharing options...
trq Posted June 25, 2008 Share Posted June 25, 2008 <?php require('FILE.php') ?> That should work correct me if i'm wrong. What are you talking about? Link to comment https://forums.phpfreaks.com/topic/111449-ask-how-to-sett-session-expired/#findComment-573882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.