html5中文学习网

您的位置: 首页 > 网络编程 > PHP编程 » 正文

PHP通过Header()函数实现文件下载_PHP教程_编程技术

[ ] 已经帮助:人解决问题

PHP通过Header()函数实现文件下载,如下代码:H5gHTML5中文学习网 - HTML5先行者学习网

  1. <html> 
  2. <head> 
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
  4. <title>应用header()函数实现下载 - www.cxybl.com</title> 
  5. <style type="text/css"> 
  6. <!-- 
  7. body { 
  8.     margin-left: 00px; 
  9.     margin-top: 0px; 
  10.     margin-right: 0px; 
  11.     margin-bottom: 0px; 
  12. a:link { 
  13.     text-decoration: none; 
  14. a:visited { 
  15.     text-decoration: none; 
  16. a:hover { 
  17.     text-decoration: none; 
  18. a:active { 
  19.     text-decoration: none; 
  20. .style1 {font-size: 12px} 
  21. --> 
  22. </style></head> 
  23.  
  24. <body> 
  25. <table width="385" height="185" border="0" cellpadding="0" cellspacing="0"> 
  26.     <form name="form1" method="post" action="index_ok.php"> 
  27.   <tr> 
  28.     <td width="55" height="85"> </td> 
  29.     <td width="275"> </td> 
  30.     <td width="55"> </td> 
  31.   </tr> 
  32.   <tr> 
  33.     <td height="30"> </td> 
  34.     <td align="center"><input type="submit" name="Submit" value="同意"> 
  35.         <input type="reset" name="Submit2" value="不同意"></td> 
  36.     <td> </td> 
  37.   </tr> 
  38.   <tr> 
  39.     <td height="30"> </td> 
  40.     <td> </td> 
  41.     <td> </td> 
  42.   </tr> 
  43.    </form> 
  44. </table> 
  45. </body> 
  46. </html> 

index_ok.php:H5gHTML5中文学习网 - HTML5先行者学习网

  1. <?php session_start(); 
  2.        if($Submit=="同意"){ 
  3.        header("location:http://www.cxybl.com/templets/default/images/logo1.gif");} 
  4. ?> 
H5gHTML5中文学习网 - HTML5先行者学习网
H5gHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助