By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,993 Members | 1,947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,993 IT Pros & Developers. It's quick & easy.

I need a very basic bare bones type message board in asp.

P: 5
I have been searching for weeks to find asp message board code in its rawest form so that I can modify it to my needs. What I am looking for is code that will process a simple html for such as:

<html><head><title>title</title></head>
<body>
<form method="post" action="aspPage.asp">
Enter your comments:<br>
<textarea name= "postedText" rows="8" cols="110">
</textarea><br>
Enter your name:
<input type="text" name="name"><br>
<input type="submit" value="Submit your Comment">
</form></body></html>

and then take the data entered into the form and save it to a file (maybe a .txt file) and then be able to retrieve the comments from the file and print them to a "comments" page. Also this page would be automatically updated when the user submits the form.

I am a little familliar with asp, but am still learning. All I have figured out so far though is how to save the form data to a variable like:

<%
Dim postedText, name
postedText=Request.Form("postedText")
name=Request.Form("name")
%>

If anyone could help me with the simplest code possible to perform this task, I would be very greatfull! I want the bare bones code so I can learn from it and expand it. Also I am trying to avoid the use of a database. Is this all possible?
Mar 30 '08 #1
Share this Question
Share on Google+
5 Replies


DrBunchman
Expert 100+
P: 979
Hi Ian,

Welcome to The Scripts!

Why are you trying to avoid the use of a database? You'll need to store the posted data somewhere and a .txt file isn't really structured enough to do so. If you didn't want to use a database you could use XML but I think that's more suited for passing data between systems rather than just storing it.

Is it the technical side of using a database that puts you off? If so there are plenty of people at The Scripts who will be more than happy to help you.

Do any other Experts have any views on creating a non-db message board and whether it's possible?

Dr B
Mar 31 '08 #2

P: 5
Hi Ian,

Welcome to The Scripts!

Why are you trying to avoid the use of a database? You'll need to store the posted data somewhere and a .txt file isn't really structured enough to do so. If you didn't want to use a database you could use XML but I think that's more suited for passing data between systems rather than just storing it.

Is it the technical side of using a database that puts you off? If so there are plenty of people at The Scripts who will be more than happy to help you.

Do any other Experts have any views on creating a non-db message board and whether it's possible?

Dr B
Dr. B,
Thank You very much for your timely reply! I am not totally opposed to using a database. Really this is a learning exercise for me and I need to understand the File System Object better. Can you tell me if it would be possible to open a .txt file, save the new post to the end of that file and then print the file to a page to display the posts??? I can figure out the code for that, but when I try to run simmiliar code on my server (I am using a free hosting provider "www.webng.com) it gives me error 500 internal server error. For example the code I just tried was:

asp page:

<html>
<head>
<title>Processing the html form</title>
</head>
<body>
<%
Dim postedText, name
postedText=Request.Form("postedText")
name=Request.Form("name")
Response.Write(postedText & <br>)
Response.Write(name)
%>
</bodY>
</html>


and the html page was just a simple form:
<html>
<head>
<title>
Post your comment
</title>
</head>
<body bgcolor="black">
<center>
<h1><font color="lime"><u>Visitor Comments Page:</u></h1></font></center><br>
<form method="post" action="aspPage.asp">
<font color="pink">Enter your comment below:
</font><br>
<textarea name= "postedText" rows="8" cols="110">
</textarea><br>

<font color="pink">Enter your name:</font>***
<input type="text" name="name">
**spacer***
<input type="submit" value="Submit your Comment">****
<font color="pink">Your comment will appear below!</font>
</form>
</body>
</html>

Can you see any reason why that code should return an error (http error 500 internal server error)? I asked the server providers and they said that if I run the script in the "data" folder, the data folder has write permissions, so I did that and still no luck. Any suggestions would be greatly appreciated!

Thanx again,
Ian11
Mar 31 '08 #3

P: 5
Opps, I am sorry! I found my mistake from the last post I made. I corrected the code in the asp page by changing the Response.Write(postedText & <br>) to Response Write(postedText) and the script will run on my free host's server. So, the only problem the server still has is running scripts that use the file system object to open, write to and close a file.
Mar 31 '08 #4

P: 5
I finally got ahold of my web host and they tell me that they have disabled using the filesystem object. Does anyone know how I can do this without using it?
Apr 5 '08 #5

DrBunchman
Expert 100+
P: 979
Hi Ian,

As your website is hosted by a third party it is understandable (but annoying)! that they don't allow you to access the file structure on their box. This article explains how you can use a Stream object to manipulate files but I would be surprised if your hosting company hasn't disabled that as well. Worth a shot though!

If not then you may now be forced to use a database to store your data....are you up for giving it a go?

Dr B
Apr 7 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.