Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Including external .html files

Including external .html files
Thread Tools
cgc
Mac Elite
Join Date: Mar 2003
Location: Virginia
Status: Offline
Reply With Quote
Apr 13, 2006, 12:49 PM
 
Hi. I have created an Automator workflow that downloads some statistics from another website to my computer, converts it to proper text encoding, then opens a RealBasic parser I wrote that scans the file looking for specific items. The parser's output is an .html table that gets passed back to the Automator workflow and it uploaded to my web site.

My problem is I don't know how to include that newly generated .html file into my existing document (show it inline with the rest).

Is there a way to include the external .html file in my existing index.html? I thought I was done...hehehe. Thanks.
     
Mac Elite
Join Date: Mar 2001
Location: CO
Status: Offline
Reply With Quote
Apr 14, 2006, 03:09 PM
 
Well, to those of us spoiled by PHP (and therefore using .php extensions instead of .html), It's just a matter of

<?php
include "../parseroutputfile.txt";
include "http://www.otherwebsite.com/parseroutputfile.php";
include "http://www.stillanotherbunchofhtml.com/parsersoutputfile.htm";
?>

Then the RealBasic parser-created file should not actually have HTML headers,etc... just the actual html code. Its HTML will appear in your existing document just as if you hand-coded it where the bracketed PHP code appears.

I have not had to learn alternatives, given PHP.

You DO need to have existing file end in .php (or something else that your server is set to parse through its PHP routines).

PHP: Don't code HOME without it.
TOMBSTONE: "He's trashed his last preferences"
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 14, 2006, 03:22 PM
 
Or you could use an iframe.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Apr 14, 2006, 07:18 PM
 
php is a great solutions. you can also use apache includes if you wanted.

<!-- #include file="filename.html" -->

(Though I recommend PHP over it.)
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Mac Elite
Join Date: Jan 2002
Location: Live at the BBQ
Status: Offline
Reply With Quote
Apr 23, 2006, 07:01 PM
 
you could also try SSI (server side include), which means you could save your RealBasic output to a plain txt file (or html, if you prefer). So your main file would be named index.shtml, and at the proper location where you want to insert the new file, you would add
Code:
<!--#include file="newfile.txt"-->
"Bill Gates can't guarantee Windows... how can you guarantee my safety?"
-John Crichton
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:37 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2