/    Sign up×
Community /Pin to ProfileBookmark

wrong code: why?

I got the code from the link:
[url]http://www.webdeveloper.com/forum/showthread.php?t=165252[/url]

in my php file (download.php), I add code:

<?php
header(“Content-type: application/zip”);
include “/path/to/file/myfile.zip”;
echo file_get_contents(“/path/to/file/myfile.zip”);
exit;
?>

but when I visit the php file, I download the php file itself (download.php) rather than the zip file “/path/to/file/myfile.zip” indicated in code.

My purpose is to hide the link “/path/to/file/myfile.zip” from user.

Could you find code errors and help me to complete my target?

thanks

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@WejMay 03.2008 — I got the code from the link:

http://www.webdeveloper.com/forum/showthread.php?t=165252

in my php file (download.php), I add code:

<?php

header("Content-type: application/zip");

include "/path/to/file/myfile.zip";

echo file_get_contents("/path/to/file/myfile.zip");

exit;

?>

but when I visit the php file, I download the php file itself (download.php) rather than the zip file "/path/to/file/myfile.zip" indicated in code.

My purpose is to hide the link "/path/to/file/myfile.zip" from user.

Could you find code errors and help me to complete my target?

thanks[/QUOTE]


I am not advanced enough to tell you if your coding is wrong. But when i had the problem with the page downloading the php file instead of processing it, it was because the server didn't know what a php was. Solved the problem once i activated it.
×

Success!

Help @html20009876 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...