PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 6th, 2002, 10:09 AM
freedimension freedimension is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Germany
Posts: 15 freedimension User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to freedimension
.php download

Hi there,

is there a way to allow .php files (from my own server) to get downloaded (Bypassing the parsing by the Webserver)

thx 4 reading
freedimension

Reply With Quote
  #2  
Old November 6th, 2002, 10:14 AM
Colonel-Panic Colonel-Panic is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 39 Colonel-Panic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: .php download

Possibly but as long as you go through port 80 and you have a web server running its going to get parsed. You could telnet or SSH and get ahold of it but now your talking illegal things.

Reply With Quote
  #3  
Old November 6th, 2002, 10:20 AM
freedimension freedimension is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Germany
Posts: 15 freedimension User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to freedimension
RE: .php download

No, you misunderstood my question.
I wanted to know:

if it is possible to make one of my own .php files downloadable (via a seperate .php script pushing the right buttons) and leaving the .php -appendix untouched.
This is for an online administration tool.

Reply With Quote
  #4  
Old November 6th, 2002, 12:24 PM
Colonel-Panic Colonel-Panic is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 39 Colonel-Panic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: .php download

Ohh haha Yeah it is I`m sure of it let me write the code real fast and test it. This could take a little while because I`m working on my forum.. If anyone else has the code before me post it.

Reply With Quote
  #5  
Old November 6th, 2002, 03:10 PM
hermawan's Avatar
hermawan hermawan is offline
Superman is not dead
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Jakarta, Indonesia
Posts: 553 hermawan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 26 m 38 sec
Reputation Power: 2
Send a message via ICQ to hermawan Send a message via AIM to hermawan Send a message via Yahoo to hermawan Send a message via Google Talk to hermawan Send a message via Skype to hermawan
RE: .php download

Write this code below, then your code (yourfile.php) will be downloaded.

<?php
$fp = fopen("yourfile.php", "r");
$content = fread($fp, filesize("yourfile.php"));
Header ('Content-type: application/octetstream');
Header ('Content-Disposition: inline; filename=yourfile.php');
?>

Reply With Quote
  #6  
Old November 6th, 2002, 06:21 PM
freedimension freedimension is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Germany
Posts: 15 freedimension User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to freedimension
RE: .php download

Cool,
thanx a lot

Reply With Quote
  #7  
Old November 6th, 2002, 07:41 PM
mudslideslim mudslideslim is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: huntsville, alabama
Posts: 4 mudslideslim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to mudslideslim
RE: .php download

i really hate to do this.. please don't hate me.. but.. TEST

Reply With Quote
  #8  
Old November 10th, 2002, 06:07 PM
freedimension freedimension is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Germany
Posts: 15 freedimension User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to freedimension
RE: RE: .php download

Quote:
Write this code below, then your code (yourfile.php) will be downloaded.

<?php
$fp = fopen("yourfile.php", "r");
$content = fread($fp, filesize("yourfile.php"));
Header ('Content-type: application/octetstream');
Header ('Content-Disposition: inline; filename=yourfile.php');
?>


With one minor change it did work.

insert this line of code (after the 2 Header-functions):
echo $content;

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > .php download


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT