Die, die im üblichen Schema übergeben werden, ja.
(Dieses lautet bekanntlich name=value&name2=value2&...)
(Dieses lautet bekanntlich name=value&name2=value2&...)
<?php
$fp1 = fopen("./test.xml","r");
while(!feof($fp1))
{
$file1 = fgets($fp1, 100);
$file = $file.$file1;
}
$fp = fsockopen("www.jogi-web.de",80,$errstr,$errno);
if(!$fp)
{
die();
}
else
{
$data = "daten=".$file;
fputs($fp, "POST /xml/xml_svr.php5 HTTP/1.1\r\n");
fputs($fp, "Host: jogi-web.de\r\n");
fputs($fp, "Referer: jogi-web.de.de\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ". strlen($file) ."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
}
$data = "";
while(!feof($fp))
{
$fget = fgets($fp, 128);
$data .= $fget;
}
fclose($fp);
$xml_arr = explode("\r\n\r\n",$data);
echo $xml_arr[1];
?>
6 Array 2 ( 1 1 1 1 1 [ 5 daten 5 ] => 486 A2 333333 91 10 3286347908514
1 20
4019238219036 2 30 8019227171624 4 1 2 ) 0
$data = "parm1=hans&parm2=Horst&parm3=paul&parm4=".$file;
//$data = urlencode($data);
fputs($fp, "POST /xml/xml_svr2.php5 HTTP/1.1\r\n");
fputs($fp, "Host: jogi-web.de\r\n");
//fputs($fp, "Referer: jogi-web.de\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ". strlen($data) ."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
foreach($_POST AS $key => $val)
{
//echo urldecode($key)." - ".urldecode($val)."<br>";
echo $key." - ".$val."<br>";
}
10 parm1 - hans
11 parm2 - Horst
10 parm3 - paul
207 parm4 - A2 23423 10 3286347908514 1
0
[B]480<b>in meiner XML-Ausgabe stehen im Browser oben und unten immer irgendwelche Codes:
</b>
<?xml version="1.0" encoding="UTF-8"?>
<ew:ind xmlns:ew="http://www.test.net">
...
</ew:inquiry_A2>
[B]0[/B]
header('Connection: close', true);
header('Content-Length: unspecified');
$data = "parm1=hans&parm2=Horst&parm3=paul&parm4=".$file;
fputs($fp, "POST /xml/xml_svr2.php5 HTTP/1.1\r\n");
fputs($fp, "Host: jogi-web.de\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ". strlen($data) ."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
header('Connection: close', true);
header('Content-Length: unspecified');
foreach($_POST AS $key => $val)
{
//echo urldecode($key)." - ".urldecode($val)."<br>";
echo $key." - ".$val."<br>";
}
Kommentar