473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
5 1878
DrBunchman
979 Expert 512MB
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
Ian11
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
Ian11
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
Ian11
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
979 Expert 512MB
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

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

Similar topics

14
by: Droolboy | last post by:
Hi. Due to the massive amount of choices in free php-based cms-systems, I thought I'd ask this group for help picking the right one. I don't need/want a fullblown portal tool. What i'm looking...
6
by: QuasiChameleon | last post by:
Hi, I'm trying to create a grayscale image class that reads and writes grayscale Targa format. This works well with smaller images, but corrupts larger images and creates a "Segmentation fault...
1
by: Richard Hollenbeck | last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank you. I try to ask relevant questions so that they don't just benefit me, but also benefit the group. I'm currently...
6
by: Jozef | last post by:
Hello, First off, let me say that I DO own XP Developers edition, so I do have a license to distribute the runtime. What I'm looking for is the bare bones files I need to deploy a runtime...
6
by: Robin Riley | last post by:
Hi, I have a .NET solution that contains a dll project and a tester application project which, of course, invokes the dll. The dll project has exception handling in it. What's happening is that...
5
by: Podrzut_z_Laweczki | last post by:
on how to make it 2 x shorter (it takes last digit from n!) just a hint :) #include <cstdio> int main(){int c;scanf("%d",&c);printf("%d\n",c?c==3?6:c==1||c==2||c==4?c:0:1);}
1
by: paul.keating | last post by:
I'm trying to write a basic Subversion client because I need to integrate Subversion with a product that keeps source code in a database (so it has no notion of "working copy"). I have tried to...
13
by: =?Utf-8?B?TWFyaw==?= | last post by:
Need help with a variable... This variable is used to keep track of permissions and can contain 1,2,4,8,16,32,64,128 Or it can contain a sum of one more of the above values. For example, if...
11
by: Chris Thomasson | last post by:
I am almost ready to post an initial prototype of my C++ memory allocator library: http://groups.google.com/group/comp.lang.c++/browse_frm/thread/beeee1f61fdbb52c Anyway, I think my C...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.