Reply
Include some file, if not found than include other?
Old 06-17-2009, 02:39 PM Include some file, if not found than include other?
Novice Talker

Posts: 9
Trades: 0
Hi, I'm very new to ASP...

So I have this code on my page

Code:
<!--#include file="somefile.txt"-->
which will show textual content of somefile.txt

Now what I want is that if somefile.txt is not found on server, I wan't the content of another textual file to be shown (someotherfile.txt)

so I need something like

Code:
<!--#include file="somefile.txt"-->
if file not found then
<!--#include file="someotherfile.txt"-->
Of course this is not correct code, so that is where I need your help... How do I write this code in ASP?

Thanks...
Error404 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 06-17-2009, 03:45 PM Re: Include some file, if not found than include other?
Decaf's Avatar
Ultra Talker

Posts: 490
Name: Adam
Trades: 0
I know that your not coding in PHP but maybe this would help.

PHP Code:
<?php
   
if ($include("somefile.php") == 0) {
        
$incllude("theOtherFile.php");
   }
?>
__________________
Decaf is offline
Reply With Quote
View Public Profile Visit Decaf's homepage!
 
Old 06-19-2009, 06:35 PM Re: Include some file, if not found than include other?
Novice Talker

Posts: 14
Name: workhomeforum
Trades: 0
Isn't this the same thread with this one http://forums.digitalpoint.com/showthread.php?t=1383033
workhomeforum is offline
Reply With Quote
View Public Profile
 
Old 06-20-2009, 05:08 PM Re: Include some file, if not found than include other?
kline11's Avatar
Small fish in a big pond

Posts: 1,371
Name: John
Location: USA
Trades: 0
Quote:
Originally Posted by workhomeforum View Post
Isn't this the same thread with this one http://forums.digitalpoint.com/showthread.php?t=1383033
Awww...you beat me to it. I was just going to reply with "Your question was already answered at DP".
__________________
SearchBliss Web Tools | Destiny
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Reply     « Reply to Include some file, if not found than include other?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11428 seconds with 13 queries