Personal Finance 1

// ********************************************************************
// Paste this block of code on the web page where you would like your
// article directory to be displayed. This code will dynamically create
// your article directory based on your GetMyArticles.com settings.
// ********************************************************************

// ********************************************************************
// **********Please DO NOT modify anything below this line*************
// ********************************************************************

error_reporting(0);

$UserKey = "U0G3-ACEN-18W4";

$ThisPage = $_SERVER["PHP_SELF"];

$QueryString = "script=php";
$QueryString .= "&Key=" .urlencode($UserKey);
$QueryString .= "&ScriptName=" .urlencode($ThisPage);

if ($_POST['action'] == 'submitnewart') {
foreach ($_POST as $key => $value) $QueryString .= “&$key=” .urlencode($value);
sendPostReq($QueryString);
exit;
}

foreach ($_GET as $key => $value) {
$value = urlencode(stripslashes($value));
$QueryString .= “&$key=$value”;
}

if ($_GET['action'] == ‘rss’) {
@header(“Content-Type: application/xml”);
}

if(intval(get_cfg_var(‘allow_url_fopen’)) && function_exists(‘readfile’)) {
@readfile(“http://getmyarticles.com/engine.php?”.$QueryString);
}
elseif(intval(get_cfg_var(‘allow_url_fopen’)) && function_exists(‘file’)) {
if($content = @file(“http://getmyarticles.com/engine.php?”.$QueryString))
echo @join(”, $content);
}
elseif(function_exists(‘curl_init’)) {
$ch = curl_init (“http://getmyarticles.com/engine.php?”.$QueryString);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);

if(curl_error($ch))
echo “Error processing request”;

curl_close ($ch);
}
else {
echo “It appears that your web host has disabled all functions for handling remote pages and as a result the GetMyArticles software will not function on your web page. Please contact your web host for more information.”;
}

function sendPostReq($data) {
$sock = fsockopen(“getmyarticles.com”, 80, &$errno, &$errstr, 30);
if (!$sock) die(“$errstr – $errno\n”);

fwrite($sock, “POST /engine.php HTTP/1.0\r\n”);
fwrite($sock, “Host: getmyarticles.com\r\n”);
fwrite($sock, “Content-type: application/x-www-form-urlencoded\r\n”);
fwrite($sock, “Content-length: ” . strlen($data) . “\r\n”);
fwrite($sock, “Accept: */*\r\n”);
fwrite($sock, “\r\n”);
fwrite($sock, “$data\r\n”);
fwrite($sock, “\r\n”);

$headers = “”;
while ($str = trim(fgets($sock, 4096))) $headers .= “$str\n”;

echo “\n”;

$body = “”;
while (!feof($sock)) $body .= fgets($sock, 4096);
echo $body;

fclose($sock);
}

?>