Is it possible to use PHP readfile() with a file on a different server?
Can I use the PHP code below if the PDF file is not on my server but on a different server with a different IP? If not, what's the best replacement? 

This code fragment was taken from this PHP tutorial: http://www.devshed.com/c/a/PHP/Simple-and-Secure-PHP-Download-Script-with-Limits-Tutorial/

	//Define the content type and show force download attachment dialog

	header("Content-type:application/pdf");
	header('Content-Disposition: attachment; filename="http://www.yourdomain.com/ebookfordownloads/ebook.pdf"');
		
	//Stream the PDF file for downloading using PHP readfile function
	//The readfile is using absolute server path
	//You can determine this path by uploading a php script to the folder containing the download material.
	/*
	<?php
	echo $_SERVER['SCRIPT_FILENAME'];
	?>
	*/
	readfile("/your/absolute/server/path/html/ebookfordownloads/ebook.pdf");
Is it possible to use PHP readfile() with a file on a different server?
===

Can I use the PHP code below if the PDF file is not on my server but on a different server with a different IP? If not, what's the best replacement? 

This code fragment was taken from this PHP tutorial: http://www.devshed.com/c/a/PHP/Simple-and-Secure-PHP-Download-Script-with-Limits-Tutorial/

	//Define the content type and show force download attachment dialog

	header("Content-type:application/pdf");
	header('Content-Disposition: attachment; filename="http://www.yourdomain.com/ebookfordownloads/ebook.pdf"');
		
	//Stream the PDF file for downloading using PHP readfile function
	//The readfile is using absolute server path
	//You can determine this path by uploading a php script to the folder containing the download material.
	/*
	<?php
	echo $_SERVER['SCRIPT_FILENAME'];
	?>
	*/
	readfile("/your/absolute/server/path/html/ebookfordownloads/ebook.pdf");