|
Author |
Message |
php4ever
Junior WebHelper


Joined: 10 Oct 2002
Posts: 49
|
Posted:
Thu Nov 21, 2002 6:09 am (22 years, 5 months ago) |
  |
Is it possible in PHP to include a file that is non-existant? I know this question may sound a bit bizarre so I'll explain. I recently learned that you can have a .htaccess file in a directory that would have a directive such that all 404s would be directed to a script and that script could create the non-existant files.
I thought that maybe I could write some code like this:
<?php
include_once("http://mysite/subdir/nonexistant.ihtml")
?>
That kind of code will produce an error message
But, if I type in the location area of the browser:
http://mysite/subdir/nonexistant.ihtml
then the .htacess file in subdir activates script2create_files.cgi and within nanoseconds one can view what was formerly a nonexistant file.
I was hoping there was a way to take this a step further with an include. So, if anyone has any ideas about how to do this, pls. let me know.
Thanks.
All best regards,
php4ever |
|
|
    |
 |
Daniel
Team Member


Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Thu Nov 21, 2002 7:13 am (22 years, 5 months ago) |
  |
Try include("http://www.yoursite.com/page.html");. Then PHP will try to access it just like you are. |
________________________________
 |
|
    |
 |
adam
Forum Moderator & Developer

Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Thu Nov 21, 2002 7:26 pm (22 years, 5 months ago) |
  |
Daniel wrote: | Try include("http://www.yoursite.com/page.html");. Then PHP will try to access it just like you are. | good idea...I was going to suggest checking if the file exists, and if it doesn't creating it before it is included...but daniel's idea is FAR less code... |
________________________________ It's turtles all the way down... |
|
     |
 |
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.150693 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |