ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-general
php-general
Re: [PHP] Retransmiting post variables
by Chris other posts by this author
Dec 12 2006 8:44PM messages near this date
Re: [PHP] How php works? | RE: [PHP] Cookies & page refresh
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/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved