i have a php file and want to give facilit for clints to dwonload file.
i am using this scritp
$id =$_GET["id"];
if($id=="php")
{
header("Content-disposition: attachment; filename=aa.php");
readfile( $_SERVER['DOCUMENT_ROOT'] . "/ShoppinScript/aa.php");
}
echo "<a href='showscript.php?id=php'>Download the file to run script in your Div</a>";
/////////
to do this file download with success but the data on containing link file write in dwonloaded file.\
like i dwonload aa.php but the data of showscript.php also added in aa.php.
i need only aa.php data.
pls help me if possible.
Helow Download php file
Moderator: General Moderators
-
shafiq2626
- Forum Commoner
- Posts: 88
- Joined: Wed Mar 04, 2009 1:54 am
- Location: Lahore
- Contact:
Re: Helow Download php file
As already answered here (shafiq2626 created this thread before his question was answered):
pradeepa wrote:$id =$_GET["id"];
if($id=="php")
{
header("Content-disposition: attachment; filename=aa.php");
readfile( $_SERVER['DOCUMENT_ROOT'] . "/ShoppinScript/aa.php");
exit; //add this line it solves your problem
}
-
shafiq2626
- Forum Commoner
- Posts: 88
- Joined: Wed Mar 04, 2009 1:54 am
- Location: Lahore
- Contact:
Re: Helow Download php file
its ok