","<",$xmlDatum); list($xmlNull,$xmlName,$xmlValue) = explode("<",$xmlDatum); $xmlr[$xmlName] = $xmlValue; } } /*----------------------------------------------------------------------------- available variables: image_link: link to image, like: http://img214.imageshack.us/img214/7053/creative0cj.jpg thumb_link: link to image thumbnail, like: http://img214.imageshack.us/img214/7053/creative0cj.th.jpg ad_link: link to imageshack page on which image is displayed, like: http://img214.imageshack.us/my.php?image=creative0cj.jpg thumb_exists: specifies whether thumb exists, either 'yes' or 'no' total_raters: specifies how many people rated image, numerical string ave_rating: specifies the average rating value, numericl string between 1 and 10 image_location: internal-style link to image, like: img214/7053/creative0cj.jpg thumb_location: internal-style link to image thumbnail, like: img214/7053/creative0cj.th.jpg server: server name on which image resides, like: img214 image_name: filename of image after it has been uploaded, like: creative0cj.jpg done_page: link to imageshack page on which users can get linking code, like: http://img214.imageshack.us/content.php?page=done&l=img214/7053/creative0cj.jpg resolution: pixel resolution of image, like: 300x250 ------------------------------------------------------------------------------*/ //sample return echo 'Upload successful!



Resolution: '.$xmlr["resolution"].'.'; //two functions, one for uploading from from file, the other for uploading from url, editing below this line advised only to those who know what they are doing :) function uploadToImageshack($filename) { $ch = curl_init("http://www.imageshack.us/index.php"); $post['xml']='yes'; $post['fileupload']='@'.$filename; curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 240); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); $result = curl_exec($ch); curl_close($ch); if (strpos($result, '<'.'?xml version="1.0" encoding="iso-8859-1"?>') === false) { return 'failed'; } else { return $result; // XML data } } function uploadURLToImageshack($url) { $ch = curl_init("http://www.imageshack.us/transload.php"); $post['xml']='yes'; $post['url']=$url; curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); $result = curl_exec($ch); curl_close($ch); if (strpos($result, '<'.'?xml version="1.0" encoding="iso-8859-1"?>') === false) { return 'failed'; } else { return $result; // XML data } } } ?>