I already have a curl script that gets the web page, but it doesn't pass the
parameters

Being new to PHP I haven't the first idea how to modify it so that it does.

Script is as follows:

$url = "http://www.xxxxxx.com/query.asp?param1=val1&param2=val2";;

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

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$data = curl_exec($ch);
curl_close($ch);

$data=str_replace('.asp', '.php', $data);
echo $data;

This returns the web page, but ignores val1 and val2 which are necessary to
execute the query.



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

Reply via email to