Indhold af side ?
Hej.Har fået denne kode i et andet spm.:
<?php
function post ($data, $url, $timeout=30) {
$url_array = parse_url($url);
$query = "";
foreach ($data as $key => $value) {
if ($query) $query .= "&";
$query.= $key."=".urlencode($value);
}
$len = strlen($query);
$headers =
"POST ".$url_array["path"]."?".$url_array["query"]." HTTP/1.1\n".
"Host: $url_array[host]\n".
"User-Agent: PHP/".phpversion()."\n".
"Content-Type: application/x-www-form-urlencoded\n".
"Content-Length: $len\n\n".
"$query\n";
$socket = fsockopen($url_array["host"], 80, $errno, $errstr, $timeout);
if (!$socket) {
return false;
} else {
fputs($socket, $headers);
while (!feof($socket)) $in .= fgets($socket, 128);
return $in;
}
echo $in;
}
echo $in;
$data = Array(
"navn" => "rasmus",
"alder" => "17");
$ind = post($data, "http://www.rasmusmadsen.dk/post/modtag.php");
echo $ind;
?>
Men nu vil jeg gerne have modtag.php´s nye html vist.. Ved nogen hvordan der gøres ?
