<?php  include("../template/pdftop.php");
	

    $url = $_GET['url'];
   $name = randcstr(6);
	
	exec("C:\\www\\shengdingkun\\wkhtmltopdf\\wkhtmltopdf.exe {$url} C:\\www\\shengdingkun\\agreement\\xieyi_".$name.".pdf");
	
	$download = 'http://'.$_SERVER['HTTP_HOST'].'/agreement/xieyi_'.$name.'.pdf';//
	header("Location:{$download}");

	function randcstr($len=6) { 
		$chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; 
		// characters to build the password from 
		mt_srand((double)microtime()*1000000*getmypid()); 
		// seed the random number generater (must be done) 
		$password=''; 
		while(strlen($password)<$len) 
		$password.=substr($chars,(mt_rand()%strlen($chars)),1); 
		return $password; 
	}

	
 ?>	