php [隐藏真实网址]

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php [隐藏真实网址]相关的知识,希望对你有一定的参考价值。

/**
 * Download the file via a PHP Script
 *
 * @param string $file the file to download
 */
function nin3_dowload_document( $file ) {
	$mime_type = mime_content_type( $file );
	$filename  = basename( $file );
	$size      = filesize( $file );

	header( 'Content-Description: File Transfer' );
	header( 'Content-Type: ' . $mime_type );
	header( 'Content-Disposition: attachment; filename=' . $filename );
	header( 'Content-Transfer-Encoding: binary' );
	header( 'Connection: Keep-Alive' );
	header( 'Expires: 0' );
	header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
	header( 'Pragma: public' );
	header( 'Content-Length: ' . $size );

	readfile( $file );
	die();
}
/**
 * Download the file via a PHP Script
 *
 * @param string $file the file to download
 */
function nin3_dowload_document( $file ) {
	$mime_type = mime_content_type( $file );
	$filename  = basename( $file );
	$size      = filesize( $file );

	header( 'Content-Description: File Transfer' );
	header( 'Content-Type: ' . $mime_type );
	header( 'Content-Disposition: attachment; filename=' . $filename );
	header( 'Content-Transfer-Encoding: binary' );
	header( 'Connection: Keep-Alive' );
	header( 'Expires: 0' );
	header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
	header( 'Pragma: public' );
	header( 'Content-Length: ' . $size );

	readfile( $file );
	die();
}

以上是关于php [隐藏真实网址]的主要内容,如果未能解决你的问题,请参考以下文章

php隐藏图片真实地址代码??

如何隐藏(或者缩短)php网站的网址 ?

php下怎么隐藏下载路径?

PHP 使用CURL库IP欺骗,隐藏真实客户端IP

php如何跳转一个链接,并隐藏这个链接?

PHP如何隐藏静态网页的真实地址及下载文件的绝对路径