Hi Guys,
I'm trying to send particular data to another page and I can not understand where the problem is.
The data that I can send is "ItemID", If I trying to get other column name (Desc) from the database I receive nothing.
Thanks..
JS code:
function tellafriend()
{
window.open('tellafriend.asp?URL=http://prodsite/prod.asp?ItemID=<%=
Request.QueryString("ItemID")%>&Desc=<%=Request.QueryString("Desc")%>',
'sendbyemail','width=400,height=300,menubar=no,status=no,location=no,
toolbar=no,scrollbars=no,screenX=200,screenY=200,left=300,top=200');
}
ASP1:
<%
Const NumPerPage = 1
Dim ItemID
If Request.QueryString("ItemID") = "" then
ItemID = 1
Else
ItemID = Request.QueryString("ItemID")
End If
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString= "DRIVER={SQL Server};SERVER=sql;DATABASE=db;UID=user;PWD=pass"
conn.Open
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
rs.CacheSize = NumPerPage
Dim strSQL
strSQL = "SELECT * FROM products"
rs.Open strSQL, Conn
rs.MoveFirst
rs.PageSize = NumPerPage
Dim TotalPages
TotalPages = rs.PageCount
rs.AbsolutePage = ItemID
Dim count
Count = 0
Do While Not rs.EOF And Count < rs.PageSize
%>
ASP2:
<%
Desc = Request.QueryString("Desc")
URL = Request.QueryString("URL")
If Len(URL) = 0 Then URL = " ' The default URL
If Len(Request.Form("SendersEmail")) > 0 Then
Dim objMail,FriendEmail,I
sBody = "The Page at " & URL & Desc & " has been recommend by " & Request.Form("SendersEmail") & vbCrLf & " -- Message -- " & vbcrlf & Request.Form("Message")
I=0
Set objMail = Server.CreateObject("SMTPsvg.Mailer")
objMail.RemoteHost = "localhost"
objMail.FromAddress = "webmaster@prodsite.com"
objMail.FromName = "Sender"
objMail.Subject = "Recommended link"
objMail.BodyText = sBody
objMail.Priority = 1
Do While True
FriendEmail = Request.Form("FriendEmail" & I)
If Len(FriendEmail) = 0 Then
Exit Do
Else
objMail.AddRecipient "form filler",FriendEmail
End If
I=I+1
Loop
On Error Resume Next
objMail.SendMail
Set objMail = Nothing
Response.write "<H1>Thank you for spreading the word</H1>"
Response.write "<a href=""" & URL & """>Click here to return to " & URL & "</a>"
Else
%>
<form method="POST" action="tellafriend.asp?URL=<%= URL %>&Desc=<%= Desc %>" style="text-align: right">
<p dir="rtl">Link:</p>
<p dir="rtl"><span lang="en-us">eMail </span>Sender: <input type="text" name="SendersEmail" size="25"></p>
<p dir="rtl"><b>Tell a friend:</b></p>
<p dir="rtl">
1. <input type="text" name="FriendEmail0" size="29"><br>
2. <input type="text" name="FriendEmail1" size="29"><br>
3. <input type="text" name="FriendEmail2" size="29"><br>
4. <input type="text" name="FriendEmail3" size="29"><br>
5. <input type="text" name="FriendEmail4" size="29"><br>
</p>
<p dir="rtl"><b>Remarks:</b></p>
<p dir="rtl"><textarea rows="6" name="Message" cols="41"></textarea></p>
<p dir="rtl"><input type="submit" value="Send"></p>
</form>
<% End If%>
I'm trying to send particular data to another page and I can not understand where the problem is.
The data that I can send is "ItemID", If I trying to get other column name (Desc) from the database I receive nothing.
Thanks..
JS code:
function tellafriend()
{
window.open('tellafriend.asp?URL=http://prodsite/prod.asp?ItemID=<%=
Request.QueryString("ItemID")%>&Desc=<%=Request.QueryString("Desc")%>',
'sendbyemail','width=400,height=300,menubar=no,status=no,location=no,
toolbar=no,scrollbars=no,screenX=200,screenY=200,left=300,top=200');
}
ASP1:
<%
Const NumPerPage = 1
Dim ItemID
If Request.QueryString("ItemID") = "" then
ItemID = 1
Else
ItemID = Request.QueryString("ItemID")
End If
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString= "DRIVER={SQL Server};SERVER=sql;DATABASE=db;UID=user;PWD=pass"
conn.Open
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
rs.CacheSize = NumPerPage
Dim strSQL
strSQL = "SELECT * FROM products"
rs.Open strSQL, Conn
rs.MoveFirst
rs.PageSize = NumPerPage
Dim TotalPages
TotalPages = rs.PageCount
rs.AbsolutePage = ItemID
Dim count
Count = 0
Do While Not rs.EOF And Count < rs.PageSize
%>
ASP2:
<%
Desc = Request.QueryString("Desc")
URL = Request.QueryString("URL")
If Len(URL) = 0 Then URL = " ' The default URL
If Len(Request.Form("SendersEmail")) > 0 Then
Dim objMail,FriendEmail,I
sBody = "The Page at " & URL & Desc & " has been recommend by " & Request.Form("SendersEmail") & vbCrLf & " -- Message -- " & vbcrlf & Request.Form("Message")
I=0
Set objMail = Server.CreateObject("SMTPsvg.Mailer")
objMail.RemoteHost = "localhost"
objMail.FromAddress = "webmaster@prodsite.com"
objMail.FromName = "Sender"
objMail.Subject = "Recommended link"
objMail.BodyText = sBody
objMail.Priority = 1
Do While True
FriendEmail = Request.Form("FriendEmail" & I)
If Len(FriendEmail) = 0 Then
Exit Do
Else
objMail.AddRecipient "form filler",FriendEmail
End If
I=I+1
Loop
On Error Resume Next
objMail.SendMail
Set objMail = Nothing
Response.write "<H1>Thank you for spreading the word</H1>"
Response.write "<a href=""" & URL & """>Click here to return to " & URL & "</a>"
Else
%>
<form method="POST" action="tellafriend.asp?URL=<%= URL %>&Desc=<%= Desc %>" style="text-align: right">
<p dir="rtl">Link:</p>
<p dir="rtl"><span lang="en-us">eMail </span>Sender: <input type="text" name="SendersEmail" size="25"></p>
<p dir="rtl"><b>Tell a friend:</b></p>
<p dir="rtl">
1. <input type="text" name="FriendEmail0" size="29"><br>
2. <input type="text" name="FriendEmail1" size="29"><br>
3. <input type="text" name="FriendEmail2" size="29"><br>
4. <input type="text" name="FriendEmail3" size="29"><br>
5. <input type="text" name="FriendEmail4" size="29"><br>
</p>
<p dir="rtl"><b>Remarks:</b></p>
<p dir="rtl"><textarea rows="6" name="Message" cols="41"></textarea></p>
<p dir="rtl"><input type="submit" value="Send"></p>
</form>
<% End If%>