I can't find the solution in my php editor.
The error starts at the 1st line of data :
can someone tell me where my error is please?
The error starts at the 1st line of data :
Code:
$data["dbType"] = "mysql";
Code:
<?php
function post_it($datastream, $url) {
$url = preg_replace("@^[URL unfurl="true"]http://@i",[/URL] "", $url);
$host = substr($url, 0, strpos($url, "/"));
$uri = strstr($url, "/");
$reqbody = "";
foreach($datastream as $key=>$val) {
if (!is_empty($reqbody)) $reqbody.= "&";
$reqbody.= $key."=".urlencode($val);
}
$contentlength = strlen($reqbody);
$reqheader = "POST $uri HTTP/1.0\r\n".
"Host: $host\n". "User-Agent: PostIt\r\n".
"Content-Type: application/x-[URL unfurl="true"]www-form-urlencoded\r\n".[/URL]
"Content-Length: $contentlength\r\n\r\n".
"$reqbody\r\n";
$socket = fsockopen($host, 80, $errno, $errstr);
if (!$socket) {
$result["errno"] = $errno;
$result["errstr"] = $errstr;
return $result;
}
fputs($socket, $reqheader);
while (!feof($socket)) {
$result[] = fgets($socket, 4096);
}
fclose($socket);
return $result;
}
?>
<? php
$data["dbType"] = "mysql";
$data["dbHost"] = "localhost";
$data["dbUser"] = "mem";
$data["dbPass"] = "letmein";
$data["dbName"] = "mel";
$data["dbPrefix"] = "mem_com_-_mel";
$data["dbPersistent"] = "false";
$result = post_it($data, " [URL unfurl="true"]http://www.mem.com/userz/mel/admin.php?");[/URL]
if (isset($result["errno"])) {
$errno = $result["errno"];
$errstr = $result["errstr"];
echo "<B>Error $errno</B> $errstr";
exit;
} else {
for($i=0;$i< count($result); $i++) echo $result[$i];
}
?>