473,387 Members | 1,742 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,387 software developers and data experts.

data won't post???

I cannot figure out what is wrong here. I have a search results page that
sends the objRst("ID") to the item_media page:

<td>
<a href="../order/item_media.asp?Id=<%=objRst("Id")%>"> Add To
Cart</a>
</td>

I will be adding options to select additional characeristics later, but for
now nothing else happens, the ID should just pass from the item_media.asp
page to the order_add.asp with this statement:
<form method="POST" action="order_add.asp" name="Order">
order_add.asp adds the ID to the shopping cart dictionary:
Sub AddItemToCart(ItemId, ItemQuantity)

If Session("Cart").Exists(ItemId) Then
Session("Cart")(ItemId) = Session("Cart")(ItemId) + ItemQuantity
Else
Session("Cart").Add ItemId, ItemQuantity
End If

End Sub

' Using a dictionary to be able to name the keys to correspond to the
' item numbers and then use their value to hold the quantity.
If Not IsObject(Session("Cart")) Then
Set Session("Cart") = Server.CreateObject("Scripting.Dictionary")
End If

ItemID = Request("ID")
ItemQuantity = 1

AddItemToCart ItemId, ItemQuantity

Response.Redirect "order.asp"
and from there it is redirected to order.asp to display all the items in the
basket:
<%
If IsObject(Session("Cart")) Then

For Each Key in Session("Cart")

objRst.Open "SELECT * FROM tape_list WHERE Id = " & Key, objConn
%>

I keep getting an "Syntax error (missing operator) in query expression 'Id
='.
/Sermons/order/order.asp, line 48" which is the objRst Open "SELECT..
statement above. I *think* the ID is not getting added to the shopping cart,
but I can't tell for sure. If I remove the item_media.asp form from the
flow, it works perfectly. Can anyone see what I'm missing? I don't
understand why the word "key" is used, is it significant or just convienent?
I don't see it defined or dim'd elsewhere.

you can see this page at www.bookfixer.com/prototype/

Thank you for any help you can provide.

Jim

Jul 22 '05 #1
2 3090
Gazing into my crystal ball I observed "Jim Wood" <mi*****@bookfixer.com>
writing in news:eE*************@TK2MSFTNGP12.phx.gbl:
I cannot figure out what is wrong here. I have a search results page
that sends the objRst("ID") to the item_media page:

<td>
<a href="../order/item_media.asp?Id=<%=objRst("Id")%>"> Add
To
Cart</a>
</td>

I will be adding options to select additional characeristics later, but
for now nothing else happens, the ID should just pass from the
item_media.asp page to the order_add.asp with this statement:
<form method="POST" action="order_add.asp" name="Order">
order_add.asp adds the ID to the shopping cart dictionary:
Sub AddItemToCart(ItemId, ItemQuantity)

If Session("Cart").Exists(ItemId) Then
Session("Cart")(ItemId) = Session("Cart")(ItemId) + ItemQuantity
Else
Session("Cart").Add ItemId, ItemQuantity
End If

End Sub
Where are you referencing the id? If you are sending the id in a
querystring, then you need to get it from the querystring collection and
probably put it in an hidden field before you do the post to another page.
Then that page can look at the request.form collection to get the id.

' Using a dictionary to be able to name the keys to correspond to the
' item numbers and then use their value to hold the quantity.
If Not IsObject(Session("Cart")) Then
Set Session("Cart") = Server.CreateObject("Scripting.Dictionary")
End If

ItemID = Request("ID")
ItemQuantity = 1

AddItemToCart ItemId, ItemQuantity

Response.Redirect "order.asp"
and from there it is redirected to order.asp to display all the items
in the basket:
<%
If IsObject(Session("Cart")) Then

For Each Key in Session("Cart")

objRst.Open "SELECT * FROM tape_list WHERE Id = " & Key, objConn
%>

I keep getting an "Syntax error (missing operator) in query expression
'Id
='.
/Sermons/order/order.asp, line 48" which is the objRst Open "SELECT..
statement above. I *think* the ID is not getting added to the shopping
cart, but I can't tell for sure. If I remove the item_media.asp form
from the flow, it works perfectly. Can anyone see what I'm missing? I
don't understand why the word "key" is used, is it significant or just
convienent? I don't see it defined or dim'd elsewhere.

you can see this page at www.bookfixer.com/prototype/
<% 'Response.Redirect "welcome.htm" %>

Thank you for any help you can provide.

Jim


--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #2

"Adrienne" <ar********@sbcglobal.net> wrote in message
news:Xn****************************@207.115.63.158 ...
Gazing into my crystal ball I observed "Jim Wood" <mi*****@bookfixer.com>
writing in news:eE*************@TK2MSFTNGP12.phx.gbl:
I cannot figure out what is wrong here. I have a search results page
that sends the objRst("ID") to the item_media page:

<td>
<a href="../order/item_media.asp?Id=<%=objRst("Id")%>"> Add
To
Cart</a>
</td>

I will be adding options to select additional characeristics later, but
for now nothing else happens, the ID should just pass from the
item_media.asp page to the order_add.asp with this statement:
<form method="POST" action="order_add.asp" name="Order">
order_add.asp adds the ID to the shopping cart dictionary:
Sub AddItemToCart(ItemId, ItemQuantity)

If Session("Cart").Exists(ItemId) Then
Session("Cart")(ItemId) = Session("Cart")(ItemId) + ItemQuantity
Else
Session("Cart").Add ItemId, ItemQuantity
End If

End Sub


Where are you referencing the id? If you are sending the id in a
querystring, then you need to get it from the querystring collection and
probably put it in an hidden field before you do the post to another page.
Then that page can look at the request.form collection to get the id.

' Using a dictionary to be able to name the keys to correspond to the
' item numbers and then use their value to hold the quantity.
If Not IsObject(Session("Cart")) Then
Set Session("Cart") = Server.CreateObject("Scripting.Dictionary")
End If

ItemID = Request("ID")
ItemQuantity = 1

AddItemToCart ItemId, ItemQuantity
this is where I am trying to grab the ID -- ItemID = Request("ID") -- it
works just fine from:
<a href="../order/item_media.asp?Id=<%=objRst("Id")%>"> Add To Cart</a>
on the sending form, but not when the sending form uses:
<form method="POST" action="order_add.asp" name="Order">
I'll try the hidden field and see if that will work.

Response.Redirect "order.asp"
and from there it is redirected to order.asp to display all the items
in the basket:
<%
If IsObject(Session("Cart")) Then

For Each Key in Session("Cart")

objRst.Open "SELECT * FROM tape_list WHERE Id = " & Key, objConn
%>

I keep getting an "Syntax error (missing operator) in query expression
'Id
='.
/Sermons/order/order.asp, line 48" which is the objRst Open "SELECT..
statement above. I *think* the ID is not getting added to the shopping
cart, but I can't tell for sure. If I remove the item_media.asp form
from the flow, it works perfectly. Can anyone see what I'm missing? I
don't understand why the word "key" is used, is it significant or just
convienent? I don't see it defined or dim'd elsewhere.

you can see this page at www.bookfixer.com/prototype/
Thank you for any help you can provide.

Jim


--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Thanks!

Jim
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
5
by: Nelson Minar | last post by:
I'm writing some code to upload photos to Flickr. The Photo Upload API requires documents be POSTed via a multipart/form-data request. I was surprised to learn that Python 2.3's HTTP clients don't...
6
by: Matt | last post by:
Is it possible to post form data and open an invisible window? For example, in page1.as <form action="page2.asp" method="POST" It will post the form data from page1.asp to the server, and...
18
by: xarax | last post by:
Greetings, What is the general practice, usual and customary way, of including a data file into a source file? I have some large data structures defined as source similar to: ...
5
by: Rod | last post by:
I've written 2 ASP.NET applications (I've worked on one with a team and another by myself). In my ASP.NET pages, when saving data to a backend database I've done it by using the click event of a...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
1
by: MasoodAdnan | last post by:
How can I post data to websites, using windows app? For example, I have a windows app (vb.net) which has some user inputs and then it wants to post data to monster.com. This way user won't have...
23
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
4
by: David Veeneman | last post by:
I want to programmatically create some POST data on a web server, then pass that data to another web page that the server calls, using Server.Transfer(). What's the best way to do that? I'm...
4
by: dac | last post by:
I am quietly going insane on this project. I've never worked on a project like this one before. All my previous sticky forms were for data entry, not editing. I don't know how to display the form...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.