Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 HTML Writer
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Acid




PostPosted: Tue Apr 13, 2004 9:11 am   Post subject: HTML Writer

My friend has a photo album on his web page, and he uses three HTML files for every picture. Every file is similar, but needs to have different picture names, etc. in different spots. Until now he's been going through the files and changing them, but that takes a long time. I want to make a program that creates the file and writes all the necessary code for him when he inputs the picture names, etc.. What's the easiest way to do this?
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Tue Apr 13, 2004 3:07 pm   Post subject: (No subject)

Hmmm.... something like PHP or eRuby would work really well. Python or Perl wil make it easy enough as well. Much easier than VB, actually.

code:
<%# eRuby sample %>

<html>
<head>
   <title>My Simple Page</title>
</head>
<body>
   <img src="<%= image_name %>"/>
</body>
</html>
Acid




PostPosted: Tue Apr 13, 2004 7:12 pm   Post subject: (No subject)

Yeah, and that'd be great if I knew anything but VB Laughing
wtd




PostPosted: Tue Apr 13, 2004 8:05 pm   Post subject: (No subject)

The Pragmatic Programmers book online.

Ruby is exceptionally easy to learn, and eRuby is just Ruby embedded in a text document.
Acid




PostPosted: Tue Apr 13, 2004 9:48 pm   Post subject: (No subject)

Thanks man. But if it takes learning a new language, then to hell with it, I'll let my friend keep doing it the way he has been. Laughing
wtd




PostPosted: Tue Apr 13, 2004 11:13 pm   Post subject: (No subject)

Well, what if learning the language and learning how to accomplish the task is easier than learning how to do it in VB?
Tony




PostPosted: Tue Apr 13, 2004 11:18 pm   Post subject: (No subject)

lol, wtd - just show poor Acid how to do that in VB Rolling Eyes

you basically write the same as to any other text file, but you save it as *.html and write your tags in there

code:

Open "C:\webpage.html" For Append As 1
Print #1, "<html><head><title>Some Title, this could be a variable</title></head><body>"
Print #1, "this goes on the actual page... some variables, some counters, etc"
Print #1, "</body></html>
Close 1
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
wtd




PostPosted: Tue Apr 13, 2004 11:50 pm   Post subject: (No subject)

Well, actually I'm not familiar with how to do it in VB myself. Smile
Acid




PostPosted: Wed Apr 14, 2004 9:11 am   Post subject: (No subject)

tony wrote:
code:

Open "C:\webpage.html" For Append As 1
Print #1, "<html><head><title>Some Title, this could be a variable</title></head><body>"
Print #1, "this goes on the actual page... some variables, some counters, etc"
Print #1, "</body></html>
Close 1


Yeah, I started it that way, but there are too many quotation marks in the HTML code. You can see how that might be a problem... Well, to someone who's basically clueless, anyway.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: