Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Download, Dodaje sie kod html
marcio
post
Post #1





Grupa: Zarejestrowani
Postów: 2 291
Pomógł: 156
Dołączył: 23.09.2007
Skąd: ITALY-MILAN

Ostrzeżenie: (10%)
X----


Witam mam taki link:
Kod
<td align="right" style="background-color: #000000;"><a href="?action=download&cid='.$_GET['cid'].'"><img src="./img/down2.jpeg" alt="dowload"></a></td>


I kod php:
  1. <?php
  2. else if(isset($_GET['action']) && $_GET['action'] == 'download') {
  3.  
  4.  header("Content-Type: application/force-download");
  5.  header('Content-Type: application/x-unknown');;
  6.  header("Content-Type: application/download");
  7.  header('Content-Disposition: attachment; filename=file_'.$_GET['cid'].'.php');
  8.  header("Content-Length: ".filesize('./url/file/file_'.$_GET['cid'].'.php'));
  9.  readfile('./url/file/file_'.$_GET['cid'].'.php');
  10.  
  11.  }
  12. ?>

Wszystko ladnie dziala tylko do sciaganego pliku dodaje sie wygenerowany przez php kod html od strony z ktorej plik jest sciagany czy ktos moze powiedziec co jest zle??
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 26.09.2025 - 23:27