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? Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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> Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
nicx Posted June 25, 2008 Author Share Posted June 25, 2008 Ok! Thanks master Quote Link to comment Share on other sites More sharing options...
nicx Posted June 25, 2008 Author Share Posted June 25, 2008 Ok! Thanks master Quote Link to comment Share on other sites More sharing options...
nicx Posted June 25, 2008 Author Share Posted June 25, 2008 Ok! Thanks master Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.