r_honey Posted July 5, 2007 Share Posted July 5, 2007 In some situations, I want to redirect my user to a page with some information being posted to the page. Getting data is very easy by just extending the URL with the parameters. Is this possible with the header function. Or is there any other method of accompolishing this??? Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/ Share on other sites More sharing options...
mmarif4u Posted July 5, 2007 Share Posted July 5, 2007 Yes it possible to send data in header. Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290188 Share on other sites More sharing options...
r_honey Posted July 5, 2007 Author Share Posted July 5, 2007 So, How can I post it??? Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290190 Share on other sites More sharing options...
suma237 Posted July 5, 2007 Share Posted July 5, 2007 try this $url=index.php; header("Location:$url"); Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290194 Share on other sites More sharing options...
r_honey Posted July 5, 2007 Author Share Posted July 5, 2007 Where did you post the data in your reply to index.php?? Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290197 Share on other sites More sharing options...
suma237 Posted July 5, 2007 Share Posted July 5, 2007 are you using any form? Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290200 Share on other sites More sharing options...
r_honey Posted July 5, 2007 Author Share Posted July 5, 2007 Nope... Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290207 Share on other sites More sharing options...
mmarif4u Posted July 5, 2007 Share Posted July 5, 2007 Can u be more clear with ur q. U want to send data from one page to another. U want to use header except of a link. And then get the data there by using GET. R u want that. Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290209 Share on other sites More sharing options...
r_honey Posted July 5, 2007 Author Share Posted July 5, 2007 In my script, sample.php, for the following redirection: header("Location: anotherPage.php?isValid=true"); isValid is passed to anotherPage.php in the URL, so has to be retrieved using Get. The only thing I want to change for the above redirection is that I want to pass the value isValid using Post, so that it is invisible to the user. Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290216 Share on other sites More sharing options...
mmarif4u Posted July 5, 2007 Share Posted July 5, 2007 I think than use session. if u want it more secure and hide from user. Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290219 Share on other sites More sharing options...
redarrow Posted July 5, 2007 Share Posted July 5, 2007 mod_rewrite ok. Quote Link to comment https://forums.phpfreaks.com/topic/58502-posting-data-with-header/#findComment-290220 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.