Re: curl and variable parameters in hyperlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
> foreach ($_POST as $key=>$post) {
>        $post=str_replace(" ", "+", $post);
>        $url.=$key."=".$post."&";
>        }
>

Hi Bob,

One thing I see is that you're appending values on to the end of a url that
already has 2 values, so you should place the "&" at the beginning of your
line instead of at the end.  Value 2 is being merged with whatever value is
coming after it in your example.  So, try something like:

$url .= "&" . $key. "=" .$post;

Also, I'd suggest url encoding the post value rather than merely hunting
down spaces and swapping them out with "+".

Hope this helps,

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux