Re: Downloading PHP source from a PHP filename, possible?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Thanks for the code(s), finally got it to display in a
page.  But I crashed the server in the attempt.  Very
bad thing I did... Which threw out over 3000 processes
for just visiting the page the one time... eck!

It was nasty, I hope noone else attempts it.  If
people want the code that I used that simply caused
more headaches than anything else I am happy to post
it.  Than again why would you want it?  So than again
I may not. :P

Okay finally I have multiple domains.

domain1.com
domain2.com

Is it possible to grab the source using some PHP code
from domain2.com and display it on domain1.com?

There *must* be some way, because when you point your
web-browser to domain1.com it loads the source, so
windows reads the source to display and the webserver
handles the requests.  So there must be some way to
actually grab it?  Or no?  I don't mean the HTML
source I mean the entire PHP source.

Thinking about it more maybe it is not that possible
as the web-server handles the PHP requests and than
the browser outputs it from what the web-server says.

I dunno, but how is it possible to grab local PHP
source but not from another domain?  I'd think it work
in the same manner but guess there is something
locking that out.

I own both domains and thought it be easier to have
one domain for the code and one domain for displaying
the code.  So I could use the other domain to test
with and users could also and the other domain for
demo's on what to do to achieve things with PHP/mysql
etc. Which Only I can edit.

I understand PHP has a ftp service in PHP, could this
work to download the source?

Thanks for your time.

Jerry



Date: Fri, 28 Nov 2003 22:35:16 -0500 
From: "David T-G" <davidtg-php@xxxxxxxxxxxxxxx> 
To: "PHP DB list" <php-db@xxxxxxxxxxxxx> 
CC: "JeRRy" <jusa_98@xxxxxxxxx> 
Subject: Re:  Downloading PHP source from a
PHP filename, possible? 


Jerry --

...and then JeRRy said...
% 
% Hi,

Hi!


% 
...
% If a file is called blah.php and is only tailored to
% PHP code is it possible to make it downloadable
either
% as a file-download or appear as plain text in a
% browser window?

You could probably manage anything, though it might be
a little tricky;
if you really insisted on having just the one file,
I'd actually have a
wrapper script which is allowed to display the php
source of another
file.  Hmmm...  As I think about it, there's probably
no reason that
special script couldn't display itself, which means
there's no reason
your original file couldn't display itself either;
you'd no doubt have 
a
"display" function just for that.  Gonna have to think
about that one.

Anyway, what I usually do if I have a need to display
the source of
running code is just make a symlink as either blah.txt
or blah.phps
(depending on whether I want it to be readable on the
surfer's windows
box after downloading or want colorization by apache)
so that I save
space and have only one thing to maintain.  I could
use a hard link but
then it's easy to forget that it's a link :-)

But I'm going to have to go and think about including
and recursion for 
a
bit, starting with how to do it for some specific
other file.  It could
be as easy as

  print file("blah.php") ;

or such...


HTH & HAND

:-D



http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux