Print Page | Close Window

Save page

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=9055
Printed Date: 31 March 2026 at 1:36am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Save page
Posted By: single_minded98
Subject: Save page
Date Posted: 20 January 2004 at 2:44am
 I have html page and user must input some data.
When the user press submit button the data must save into
database. How i want to save the page as .html format
or .xml format.


-------------
Learn More



Replies:
Posted By: zMaestro
Date Posted: 20 January 2004 at 7:31am

you can post this in the ASP forum.

http://forums.webwiz.net/forum_topics.asp?FID=9 - http://forums.webwiz.net/forum_topics.asp?FID=9



Posted By: zMaestro
Date Posted: 20 January 2004 at 7:37am

anyway, you can save the page as .asp

and write this code to save to database.

Dim Conn, DSN
DSN = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("./database.mdb")
set Conn = Server.CreateObject ("ADODB.connection")
Conn.Open DSN

Dim RS, SQL
Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM TableName"
RS.CursorType = 2
RS.LockType = 3
RS.Open SQL, Conn

RS.AddNew
RS.Fields("Name") = Request.Form("Name")
RS.Fields("Email") = Request.Form("Email")
RS.Update
RS.Close
Set RS = Nothing

 

 

something like this will work



Posted By: single_minded98
Date Posted: 25 January 2004 at 7:56pm

Thanks..

To save the data i already done. But how to save the page.



-------------
Learn More


Posted By: dpyers
Date Posted: 26 January 2004 at 2:33am
Do you want to save the original form page with the fields filled in?

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: single_minded98
Date Posted: 26 January 2004 at 2:37am
Yup

-------------
Learn More


Posted By: zMaestro
Date Posted: 26 January 2004 at 4:11am
i think how can he read it back from the database.


Posted By: single_minded98
Date Posted: 26 January 2004 at 4:26am

In the database i just save the name of files and then to view i just put href.

p/s : is there any syntax to save the page



-------------
Learn More


Posted By: pmormr
Date Posted: 27 January 2004 at 5:10pm
he wants to save the data into an HTML file so you can view it via href links... you'd just compose an HTML document with all your data in it and then save it with FileSystemObject

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: single_minded98
Date Posted: 28 January 2004 at 1:03am

Thanks pmormr ...

I'm before this not doing the web development can u give me example code that can help me doing that thing.



-------------
Learn More


Posted By: pmormr
Date Posted: 28 January 2004 at 7:03pm
i'm not exactly sure how i would do this but here's an example that should give you the right idea...


<%
Dim myHTML
myhtml= "This is html code..."
Dim fso, newFile
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Dim filename
filename = "test.html"
Set newFile = fso.createtextfile("c:\myFiles\" & filename, true)
newFile.WriteLine(myHTML)
newfile.close
set fso = nothing
set newfile = nothing
%>



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: pmormr
Date Posted: 28 January 2004 at 7:04pm
just make sure your filename is different for each time or it will either overwrite your file that was there before or give you an error

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: single_minded98
Date Posted: 28 January 2004 at 7:57pm

Thanks pmormr...

I'll try first



-------------
Learn More



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net