nikhilthecool Posted June 14, 2006 Share Posted June 14, 2006 HiI have a login form in which i submit the username and password this way...<form action="index.php" method="post"><input type="text" name="username"><input type="text" name="password"><input type="hidden" name="option" value="login"><input type="submit" name="Submit" class="button" value="Login" ></form>Now, i after i submit the login form i need to submit the login information. So i use the hidden field option so that it goes to index.php?option=login ...(Is it so? I'm not sure)Also I need to submit the same information to another page where i need to use option=forumNow how do i do this? Basically, i'm trying to modify my application so that user need not login two times(in the website and forum differently)Please Help..!! Quote Link to comment https://forums.phpfreaks.com/topic/11964-passing-variables-to-more-than-one-php-page/ Share on other sites More sharing options...
nikhilthecool Posted June 14, 2006 Author Share Posted June 14, 2006 somebody please...atleast give me some alternate solution...plsss... Quote Link to comment https://forums.phpfreaks.com/topic/11964-passing-variables-to-more-than-one-php-page/#findComment-45452 Share on other sites More sharing options...
d_barszczak Posted June 14, 2006 Share Posted June 14, 2006 [!--quoteo(post=383712:date=Jun 14 2006, 12:13 PM:name=nikhilthecool)--][div class=\'quotetop\']QUOTE(nikhilthecool @ Jun 14 2006, 12:13 PM) [snapback]383712[/snapback][/div][div class=\'quotemain\'][!--quotec--]somebody please...atleast give me some alternate solution...plsss...[/quote]Once your users have logged in you can store the variables in a cookie or using php sessions.Once you do this all your other php pages can that access these variables.Sessions are better as they run from the server side but webhosts sometimes dont allow them and cookies can be stopped by a user that turns off cookies. Quote Link to comment https://forums.phpfreaks.com/topic/11964-passing-variables-to-more-than-one-php-page/#findComment-45497 Share on other sites More sharing options...
joquius Posted June 14, 2006 Share Posted June 14, 2006 [!--quoteo(post=383760:date=Jun 14 2006, 02:31 PM:name=scripts2go.co.uk)--][div class=\'quotetop\']QUOTE(scripts2go.co.uk @ Jun 14 2006, 02:31 PM) [snapback]383760[/snapback][/div][div class=\'quotemain\'][!--quotec--]Once your users have logged in you can store the variables in a cookie or using php sessions.Once you do this all your other php pages can that access these variables.Sessions are better as they run from the server side but webhosts sometimes dont allow them and cookies can be stopped by a user that turns off cookies.[/quote]In this case (web host disallows, or no cookies) you can make a custom session running from a database, transfering the "session id" via HTTP_VARS. (assuming you have a database on the host) Quote Link to comment https://forums.phpfreaks.com/topic/11964-passing-variables-to-more-than-one-php-page/#findComment-45503 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.