HappyPandaFace Posted March 28, 2007 Share Posted March 28, 2007 How do I just make it so I put a variable into a post data for another page with out someone having to input it into a text field? I was trying: $HTTP_POST_VARS['login'] = $login; $HTTP_POST_VARS['pass'] = $pass; But it didn't work. Link to comment https://forums.phpfreaks.com/topic/44617-post_var-with-out-input/ Share on other sites More sharing options...
DanDaBeginner Posted March 28, 2007 Share Posted March 28, 2007 you can use session.... ex: <?php session_start(); $_SESSION['login'] = $login; $_SESSION['pass'] = $pass; ?> and access it in another page by just: <?php session_start(); echo $_SESSION['login'].' '.$_SESSION['pass']; ?> Link to comment https://forums.phpfreaks.com/topic/44617-post_var-with-out-input/#findComment-216665 Share on other sites More sharing options...
HappyPandaFace Posted March 28, 2007 Author Share Posted March 28, 2007 EDIT: k thx Link to comment https://forums.phpfreaks.com/topic/44617-post_var-with-out-input/#findComment-216666 Share on other sites More sharing options...
HappyPandaFace Posted March 28, 2007 Author Share Posted March 28, 2007 Wait, it came out like this: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\Scott\login.php:3) in C:\Program Files\Apache Group\Apache2\htdocs\Scott\login.php on line 7 What happened? Link to comment https://forums.phpfreaks.com/topic/44617-post_var-with-out-input/#findComment-216668 Share on other sites More sharing options...
mjlogan Posted March 28, 2007 Share Posted March 28, 2007 Headers already sent, sessions work like cookies, you have to set them before output is sent to the browser Link to comment https://forums.phpfreaks.com/topic/44617-post_var-with-out-input/#findComment-216669 Share on other sites More sharing options...
DanDaBeginner Posted March 28, 2007 Share Posted March 28, 2007 try this: http://www.google.com.ph/search?hl=tl&q=session+PHP&btnG=Hanapin+sa+Google&meta= Link to comment https://forums.phpfreaks.com/topic/44617-post_var-with-out-input/#findComment-216680 Share on other sites More sharing options...
HappyPandaFace Posted March 28, 2007 Author Share Posted March 28, 2007 Ok I got it working. Link to comment https://forums.phpfreaks.com/topic/44617-post_var-with-out-input/#findComment-217024 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.