Re: Retransmiting post variables
| From: | Chris | Date: | Wed, 13 Dec 2006 04:41:47 +0000 |
| Subject: | Re: Retransmiting post variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245779@lists.php.net to get a copy of this message | ||
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=1&b=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/