Home > Backend Development > PHP Tutorial > Examples of PHP generating download links for Thunder, Kuaiche and QQ Tornado_PHP Tutorial

Examples of PHP generating download links for Thunder, Kuaiche and QQ Tornado_PHP Tutorial

WBOY
Release: 2016-07-13 10:31:17
Original
1621 people have browsed it

This article will introduce how to easily generate and create download link data for various third-party download tools (such as Thunder, Kuaiche, QQ Tornado) through PHP function processing, and output it directly to the front desk. At the same time, you can also convert The past link will be restored to the original download address.

The PHP functions used by this function are mainly the following two:

1. base64_encode: used to encrypt strings in base64 mode;

2. base64_decode: used to decrypt strings encrypted in base64 mode.

The following will be explained directly through examples. You can basically understand it, so I won’t explain it in detail.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>PHP生成迅雷、快车、QQ旋风下载链接的方法</title>
</head>
<body>
<?php
function zhuanhuan($url){
	if(empty($url)) return $result;
	$urlodd=explode('//',$url,2);
	$head=strtolower($urlodd[0]);
	$behind=$urlodd[1];
	if($head=="thunder:"){
		$url=substr(base64_decode($behind),2,-2);
	}else if($head=="flashget:"){
		$url1=explode('&',$behind,2);
		$url=substr(base64_decode($url1[0]),10,-10);
	}else if($head=="qqdl:"){
		$url=base64_decode($behind);
	}else if($head=="http:"||$head=="ftp:"||$head=="mms:"||$head=="rtsp:"||$head=="https:"){
		$url=array(
			'thunder'=>"thunder://".base64_encode("AA".$url."ZZ"),
			'flashget'=>"Flashget://".base64_encode("[FLASHGET]".$url."[FLASHGET]")."&aiyh",
			'qqdl'=>"qqdl://".base64_encode($url)
		);
	}else{
		return '';
	}
	return $url;
}
$url=isset($_GET['url'])?$_GET['url']:'';
$result=zhuanhuan($url);
?> 
<form action="" method=GET>
请输入普通链接或者迅雷,快车,旋风链地址:<br /> 
<input type=text name="url" size="80"> 
<input type=submit value="转换"> 
</form>
<?php
if(is_array($result)){//www.phpernote.com
?>
<p>地址:<a href="<?php echo $url;?>" target="_blank"><?php echo $url;?></a> 
<p>迅雷链:<a href="<?php echo $result['thunder'];?>" target="_blank"><?php echo $result['thunder'];?></a> 
<p>快车链:<a href="<?php echo $result['flashget'];?>" target="_blank"><?php echo $result['flashget'];?></a> 
<p>旋风链:<a href="<?php echo $result['qqdl'];?>" target="_blank"><?php echo $result['qqdl'];?></a>
<?php
}else{
?>
<p>实际地址:<a href="<?php echo $result;?>" target="_blank"><?php echo $result;?></a> 
<?php
}
?>
</body>
</html>
Copy after login

The effect of the page is as follows:

Examples of PHP generating download links for Thunder, Kuaiche and QQ Tornado_PHP Tutorial

Articles you may be interested in

  • The idea and implementation method of generating short URLs in php
  • php uses curl to implement multi-threaded classes , php curl multi-threaded download pictures
  • PHP uses Curl Functions to realize multi-threaded web crawling and downloading files
  • php generates dynamic verification code pictures (gif)
  • php gets remote Download the image and save it locally
  • php uses header() to implement file download. The downloaded file prompts that it is damaged and cannot be opened.
  • Use the PHP function memory_get_usage to obtain the current PHP memory consumption for implementation. Program performance optimization
  • A simple example of php obtaining web content through socket

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764097.htmlTechArticleThis article will introduce how to easily generate and create various third-party download tools (such as Thunder, Kuaiche, etc.) through PHP function processing. QQ Tornado) download link data and output it directly to the front desk,...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template