twindude Posted January 14, 2008 Share Posted January 14, 2008 I have a full site HTML, and would like to link to a text file to update this.i would like to have a line on the index page that saysCurrent Event: "this info come form a text file that the user can update"Upcoming Event: "this info come form a text file that the user can update"is this possible and how would this be done? do i have to use XML or what are the options? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 14, 2008 Share Posted January 14, 2008 You don't have to use XML. You can use Javascript to pull in the file using AJAX and display the contents wherever you want on the page, or you can use a server-side language like ASP or PHP or whatever to pull in the file on the server side. Link to comment Share on other sites More sharing options...
twindude Posted January 14, 2008 Author Share Posted January 14, 2008 You don't have to use XML. You can use Javascript to pull in the file using AJAX and display the contents wherever you want on the page, or you can use a server-side language like ASP or PHP or whatever to pull in the file on the server side.unmmmmmok let me see what i can come up with from that.... Link to comment Share on other sites More sharing options...
Coolguy Posted January 15, 2008 Share Posted January 15, 2008 For PHP you could do something like create the html formatting and just use a Server Side include to load the text into the specific elementEx1. <div class="p1"><?php include_once('/content.txt'); ?></div>Ex2.I use this to include a txt file in my header that displays the current version of my site and a link to a version listingThis can be seen by viewing the source on any page at http://jpasims.net // Inserted at the top of the header<?php include_once ($_SERVER['DOCUMENT_ROOT'].'/_code/site_version.txt');?>[TXT File]http://www.jpasims.net/_code/site_version.txt---------------------------------------------------------------------------This is actually a very commonly used as a CMS (content management system) where you can load and edit the content of txt files online on an admin page. Or you could create a script that connects ftp and updates the file on the server from a remote location. A little scripting magic, a fancy front-end and you can do a lot to make your site easier to update. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.