1

Right now I'm passing a variable through the url and accessing it through _GET in another file.

header('location: addtitle.php?title='.urlencode($id));

I was wondering how I could do this for _POST and also redirect to another php file....should I just add a hidden form ?

re1man
  • 2,337
  • 11
  • 38
  • 54
  • 2
    By definition you cannot pass POST variables through the URL. Do you just want to send the user to a different page while POSTing some values…? – deceze Jul 24 '11 at 02:06
  • what this php file above does is get form data and the encodes it in the url to another php file – re1man Jul 24 '11 at 02:43
  • 1
    Please see [PHP Redirect with POST data](http://stackoverflow.com/questions/5576619/php-redirect-with-post-data) and [others](http://stackoverflow.com/search?q=redirect+user+with+post+data). – deceze Jul 24 '11 at 02:49
  • Yes that would do it....I want to set up a hidden form that automatically gets submitted...could this be done in jquery though? – re1man Jul 24 '11 at 02:59

1 Answers1

2

What about trying curl to post a variable to the url?