Re: [PHP] Retransmiting post variables
On Tue, December 12, 2006 9:45 am, Fernando M. M. wrote: I have a script called redir.php that is used only for redirecting using the following code: header('Location: ', $_GET['url']); So, you have a one-line script do accomplish a one-line task? Okay. But now i need to redirect post varibles too. Example: If someone access redir.php?url=my_page.php and post: a=1b=2 I need to send this post string (as post) to my_page.php. If you need to re-post data from PHP, you can Google for Rasmus Lerdorf posttohost function and do that, or you can use http://php.net/curl or you can use any of a few hundred functions similar to the one Rasmus wrote a dozen years ago, or... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Retransmiting post variables
Hello, I have a script called redir.php that is used only for redirecting using the following code: header('Location: ', $_GET['url']); But now i need to redirect post varibles too. Example: If someone access redir.php?url=my_page.php and post: a=1b=2 I need to send this post string (as post) to my_page.php. How can i do this? Thanks. -- Blog: http://blog.forumdebian.com.br/fernando Contato: http://www.forumdebian.com.br/fernando/contato.php
Re: [PHP] Retransmiting post variables
Fernando M. M. wrote: Hello, I have a script called redir.php that is used only for redirecting using the following code: header('Location: ', $_GET['url']); But now i need to redirect post varibles too. Example: If someone access redir.php?url=my_page.php and post: a=1b=2 I need to send this post string (as post) to my_page.php. $post_string = ''; foreach ($_POST as $k = $v) { $post_string .= $k . '=' . $v . ''; } $url .= $post_string; however that's *really* insecure - you're not doing any sanity checks on any of the posted data. You need to implement some checks (ie make sure the field you want as a number is a number and so on). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php