
 chichi - 2007-09-10 04:33:55 - 
In reply to message 4 from Manuel Lemos 
hmmm, actually i had use http.class to write another class.
include_once("http.class.php");
class http_header{
	
	var $vtkturl = "https://www.myurl.com/verify_ticket?v=1&";
	var $error = "";
	
	//get ticket code, pass the ticket code
	function getTktResp($passid,$tktcode){
		$http = new http_class;
		$http->follow_redirect=1;
		$http->debug_response_body=0;
		$http->debug=0;
		$http->debug_html=0;
		$fc = new functions();
		$this->error = $http->GetRequestArguments($this->vtkturl."pssid=".$passid."&tkt=".$tktcode, $arguments);
		$arguments["Headers"]["Pragma"] = "nocache";
		flush();
		$this->error = $http->Open($arguments);
		flush();
		$this->error = $http->SendRequest($arguments);
		flush();
		$headers=array();
		$this->error=$http->ReadReplyHeaders($headers);
		if($this->error==""){
			if ($http->response_status != 200) {
				flush();
				header("Location: http://www.url.com/error.php");
			}
			for(Reset($headers),$header=0;$header<count($headers);Next($headers),$header++)
			{
				$header_name=Key($headers);
				if(GetType($headers[$header_name])=="array")
				{
					for($header_value=0;$header_value<count($headers[$header_name]);$header_value++)
						$array[$header_name]=$headers[$header_name][$header_value];
				}
				else
					$array[$header_name]=$headers[$header_name];
			}
			flush();
		}
		$http->Close();
		if ($array[s] != 1) {
			flush();
			header("Location: http://www.url.com/error.php");
		}
		else 
		return $array;
		
	}
}
it only will show the header already sent error after used http.class, the other pages didn't got this error.
i had comment or delete all echo, print, print_r, print_f .... but it still cannot work...
Thanks for kindly helping....