954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

php download a file without redirecting

i got a page index.php. i got a link over there to download.php.

in download.php i'll do some mysql things. (like count file download...) and redirect the browser to some file 123.zip.

Wot i really want is. I dont want to go to download.php instead the browser should remain in index.php while i store all data in db.
my link will be site.com/download.php?fileid=xx

and user should get the file in hand without goin to download.php. (i eman he should not go to some blank page (download.php))

i think i am clear.

please help

bennetjosem
Newbie Poster
9 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

You may use 'include' or 'require' to attach the download.php within your index file. The link to download file will be something like index.php?action=download&id=1234. When someone click the link, the index page will reload and by using isset($_GET['action']), the page will call the download program and the user still in the index page.

I hope this help.

zippee
Posting Whiz in Training
294 posts since Jan 2005
Reputation Points: 10
Solved Threads: 7
 

well thnks for the reply. but still i don want to reply. have a look at themexp.org there try download links :) i want it to be like that! thnx

bennetjosem
Newbie Poster
9 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Hello bennetjosem
is it a joke??
when i click on download it's an exe file i get!!! :rolleyes: :sad:

val542
Newbie Poster
10 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

well never mind that. just think hows that working??

bennetjosem
Newbie Poster
9 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You