Posted: Tue Jan 17, 2006 5:43 pm
Would I just put normal headers (eg. header(Something: Something);) or how else would I put it?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$postfields = array ('username' => 'TEST',
'password' => 'TEST',
'destination' => 'TEST');
$goodpost = urlencode ($postfields);
$url = 'http://neopets.com/login.phtml?';
$goodurl = urlencode ($url);
$ch = curl_init();
header('Content-Type: application/x-www-form-urlencoded');
header('Referer: http://neopets.com/hi.phtml');
curl_setopt($ch, CURLOPT_URL, $goodurl);
curl_setopt($ch, CURLOPT_POST, true);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $goodpost);
//$something = file_get_contents("http://neopets.com/stockmarket.phtml");
//$something = preg_match("#<marquee>(.*)<\/marquee>#i", $retrievedhtml, $match);
$output = curl_exec($ch);
echo $output;
echo curl_error($ch);
curl_close($ch);
?>