window.location.replace('" . $newlink . "');"; } // submit if ($Xsubmit == 1){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$target_url); curl_setopt($ch, CURLOPT_POST,true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); //If the function curl_file_create exists if(function_exists('curl_file_create')){ //Use the recommended way, creating a CURLFile object. $filePath = curl_file_create($filePath); } else{ //Otherwise, do it the old way. //Get the canonicalized pathname of our file and prepend //the @ character. $filePath = '@' . realpath($filePath); //Turn off SAFE UPLOAD so that it accepts files //starting with an @ curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); } //Setup our POST fields $postFields = array( 'zwi' => $filePath, 'pass' => $postkey ); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $txt=curl_exec($ch); curl_close($ch); $pos1 = strpos($txt, "successfully"); $pos2 = strpos($txt, "updated"); if ($txt == false) die("Failed to send the ZWI file. No server response?"); //$isOK=false; //if ($pos1 !== false ) $isOK=true; //if ($pos2 !== false ) $isOK=true; //if ($isOK == false) // die("Failed to send the ZWI file. No server response? File: ". $filePath. "mess:" . $txt); $txt=nl2br($txt); print($txt); $str = << ZWI confirm

'$title' submitted!

Read this article in the Encyclosphere Network in 10 minutes using EncycloReader created by the EncyclosphereKSF

EOD; print($str); //unlink($zwifile); // delete file } // end submit ?>