Current location: Hot Scripts Forums » Programming Languages » ASP » change the contents of an html file in asp


change the contents of an html file in asp

Reply
  #1 (permalink)  
Old 01-01-04, 07:46 PM
jaleen jaleen is offline
Newbie Coder
 
Join Date: Dec 2003
Location: Penang, Malaysia
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
change the contents of an html file in asp

hi all! I'm dealing with asp.
I would like to know how can i change the contents of an html file in asp.
For example, in bla.htm:
<html>
<head><title>bla</title></head>
<body>
bla bla bla

<table>
<tr><td>tit tit tit</td></tr>
<tr><td>bla bla bla</td></tr>
</table>

<p>bla bla bla</p>
</body>
</html>

Now, because of some requirements, I have to change the contents of 'bla bla bla' to 'tuu tuu tuu' (or other things according to the requirements) in an asp. How can I do that?
Thanks for your kindly help.
__________________
regards, jaleen
Reply With Quote
  #2 (permalink)  
Old 01-08-04, 09:53 AM
protecweb protecweb is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
You can use the File System Object for that. Lots of information on FSO here > http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=4


Quote:
Originally Posted by jaleen
hi all! I'm dealing with asp.
I would like to know how can i change the contents of an html file in asp.
For example, in bla.htm:
<html>
<head><title>bla</title></head>
<body>
bla bla bla

<table>
<tr><td>tit tit tit</td></tr>
<tr><td>bla bla bla</td></tr>
</table>

<p>bla bla bla</p>
</body>
</html>

Now, because of some requirements, I have to change the contents of 'bla bla bla' to 'tuu tuu tuu' (or other things according to the requirements) in an asp. How can I do that?
Thanks for your kindly help.
__________________
Regards, Sam - http://www.protecweb.co.uk
Windows 2003 shared and reseller hosting with .NET, MS SQL Server and lots of components.
AdvancedIcons.com - Professional XP style icons.
Reply With Quote
  #3 (permalink)  
Old 01-19-04, 08:33 PM
jaleen jaleen is offline
Newbie Coder
 
Join Date: Dec 2003
Location: Penang, Malaysia
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Thnanks for your reply. However, from the reference website, it seems that I cannot add or delete the contents from the file.

I have tried out a way, but it's quite troublesome.

I put each content that I wish to modify in a new line, like below:
<html>
<head><title>bla</title></head>
<body>
bla bla bla <! -- contents wish to modify -->

<table>
<tr><td>tit tit tit</td></tr>
<tr><td>
bla bla bla <! -- contents wish to modify -->
</td></tr>
</table>

<p>
bla bla bla <! -- contents wish to modify -->
</p>
</body>
</html>

In asp file(eg: bla.asp), I retrieve line by line from bla.htm into a string variable. By the time I retrieve into the var, I do modification on 'bla bla bla', then only save into the var. After all, I overwrite everything in the var into bla.htm again.

I have tried, and it works, but I have to maintain the order of the contents in bla.htm, or else everything will be mess up.

regrads, Jaleen

Quote:
Originally Posted by protecweb
You can use the File System Object for that. Lots of information on FSO here > http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=4
__________________
regards, jaleen
Reply With Quote
  #4 (permalink)  
Old 01-20-04, 08:09 AM
zaboss zaboss is offline
New Member
 
Join Date: Jan 2004
Location: Error 404: Zaboss not found.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Should you need to do lots of changes, perhaps it would be better to put all the items you need to modify in a db and retrieve them from there. And perhaps you could use also a tool like HTMLArea from www.interactivetools.com.
Reply With Quote
  #5 (permalink)  
Old 01-21-04, 07:41 AM
jaleen jaleen is offline
Newbie Coder
 
Join Date: Dec 2003
Location: Penang, Malaysia
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks. Actually what I do here is that I have a sample webpage(bla.htm) to show to other ppl. When the user make requirements on the contents of bla.htm, I have to generate a new webpage (eg:bla1.htm) according to the sample, but just replace the contents with the user's requirements, and the sample will stay the same there, no changes made on that sample webpage.

regards, jaleen


Quote:
Originally Posted by zaboss
Should you need to do lots of changes, perhaps it would be better to put all the items you need to modify in a db and retrieve them from there. And perhaps you could use also a tool like HTMLArea from www.interactivetools.com.
__________________
regards, jaleen
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
change the contents of an html file in asp jaleen Script Requests 0 12-30-03 01:53 PM
Please I Need help before all my hair is gone! LisatheNovice Perl 6 11-22-03 03:05 PM
Script to change file extensions JavaHead Script Requests 2 09-13-03 09:44 AM
Script for picking the first HTML file out of a directory (with sorted HTML files) jelteveld Script Requests 0 08-16-03 01:30 PM
Upload file type and size limiter! Arctic ASP 1 08-02-03 07:06 PM


All times are GMT -5. The time now is 04:01 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.