• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Storing an ASP page

Nismo83

OSNN AZN Addict
#1
Help all professional programmer out here..

I need some help regarding on storing a ASP page in the database so that the user(receiver) can access it such as greeting cards with the message key in by the sender.

I hope u guys understand what i'm blabbing 'bout :D
 
#2
Well you don't store the page. You just store the string with the message in it and assign it a unique ID number. Then the receiver opens a page with the ID number as a parameter and the page sidplas the appropriate string.
 

Nismo83

OSNN AZN Addict
#3
well.. thanks Zedric. I get the picture on how it works. But how do i store the message in a string? Any tutorial or some kind of example which explain in more detail? :D

Sorry to trouble you
 
#4
I'm not so good at ASP but since it's similar to PHP I guess it would work like this:
Make a form with a textarea (for the message). Call it "message". Submit the form using POST to another page (or the same, your choise). The message will now be available in the ASP code (in PHP is directly in the variable "message"). Then you store it in the DB.
 
#6
OK. I the new page (the page you sibmitted the form data to) you will now have a variable called "message" that contains the message the user typed in on the previous case. This is how it is in PHP. It may be different in ASP but that can easily be found out if you look at examples (there are millions on the web).
 
I

Informant

Guest
#7
This assumes you are using a access database which is very common for what you are requesting.
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "ConnectionStringHereLookForExamplesOnTheWeb"
set rs = conn.execute("Select * from tableNameHere where ColumnID = IDHERE")
%>

<!-- Apply your Html Formatting here -->

<%=rs("Message")%>

<%

conn.Close
Set rs = nothing
set conn = Nothing
%>

Now if you make a access database with 2 fields in it one called ColumnID wich will be your primary key and unique ID and one called Message that will probably be a field type "Memo" and use the little script I just wrote above you will be able to pull that info based on ID at will........
 

Nismo83

OSNN AZN Addict
#8
thanks a lot for the info..

I am currently {
| |
| |
}
=========================
Intel P4 1.5 Ghz
Intel D850GB MOBO
256MB PC 800 RDRAM
20GB Maxtor HDD (5400 RPM)
40GB Maxtor HDD (7200 RPM)
52X Creative CDROM
8X4X32 Creative CDRW
16X ASUS DVD ROM
Iomega 100 MB USB Zip Drive
SYBA Ultra ATA IDE controller card
SB live 5.1 DE
Aging Gainward 64MB GF2MX400 --> | Upgrading to GF4 Ti4 series |
Altec Lansing ACS 56
Dlink D538TX NIC

=========================
 

Nismo83

OSNN AZN Addict
#9
Code:
<%
	' connect to the MS Access database in the same directory
	strDbPath = Server.MapPath(".") & "\users.mdb"
	strconn="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("users.mdb")

	Set rs = Server.CreateObject("adodb.recordset")
	rs.Open "users", strconn, 2, 3

	If Request("Send") <> "" Then
            Set Mail = Server.CreateObject "XXX.mailserver")
		Mail.Host = strHost
		
		Mail.From = "XXX@abc.com"
		Mail.FromName = "Request("From")
		Mail.Subject = Request("Subject")
		Mail.Body = Request("Body")

		Mail.Send  ' finally send message
after storing the message, how do i incorporate it as a link to the mail that i wanted to send it out? For example is: http://www.abc.com?cards=1...

:confused:
 

Nismo83

OSNN AZN Addict
#10
Code:
<%
	' connect to the MS Access database in the same directory
	strDbPath = Server.MapPath(".") & "\users.mdb"
	strconn="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("users.mdb")

	Set rs = Server.CreateObject("adodb.recordset")
	rs.Open "users", strconn, 2, 3

	If Request("Send") <> "" Then
            Set Mail = Server.CreateObject "XXX.mailserver")
		Mail.Host = strHost
		
		Mail.From = "XXX@abc.com"
		Mail.FromName = "Request("From")
		Mail.Subject = Request("Subject")
		Mail.Body = Request("Body")

		Mail.Send  ' finally send message
after storing the message, how do i incorporate it as a link to the mail that i wanted to send it out? For example is: http://www.abc.com?cards=1...

BTW, i've done an normal mail appz and when i tried to send it, it says Error occurred: 550 5.7.1 Unable to relay for xxx@abc.com i'm using PostCast Server
:confused:
 
#12
What you do is you store the entire mail in a variable (say mailBody). Something like this:
Code:
mailBody = "Hi!\nBla bla bla, yada yada. Click below to bla bla:\n\n [url]http://www.abc.com/?cards=[/url]" &
cardID & "\n\nBla bla, yada yada.\n\nRegards\nWhoever."
Sort of anyway. ;)
Then you send it off (provided you get the SMTP to work).
 

Nismo83

OSNN AZN Addict
#13
Code:
<%
dim strID 
strID=Request("cardid")
Set con=Server.CreateObject("ADODB.Connection")
Set RecordSet=Server.CreateObject("ADODB.RecordSet")

strconn="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("data.mdb")
con.Open strconn 

sql =  "SELECT * FROM birthday WHERE cardid = strid "

set RecordSet = con.execute(sql)


Response.write RecordSet("image")
%>
When this page load it kept load the first image only.. i want it to load based on the querystring that i have select from the previous page. How do i do it?

Eg. http://www.abc.com?id=1 -> display this image
http://www.abc.com?id=2 -> display that image
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,013
Latest member
Pdawgintown