469,290 Members | 1,866 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

Problems posting with urlencode

I have the following form :
<form action="/auction/create/" method="post"><p><label
for="auction_created">Created</label><br /></p>
<p><label for="auction_user">User</label><br /><input id="auction_user"
name="auction[user]" size="30" type="text" value="" /></p>
<p><label for="auction_auction_title">Auction title</label><br /><input
id="auction_auction_title" name="auction[auction_title]" size="30"
type="text" value="" /></p>
<p><label for="auction_auction_url">Auction url</label><br /><input
id="auction_auction_url" name="auction[auction_url]" size="30" type="text"
value="" /></p>
<p><label for="auction_modification_rec">Modification rec</label><br
/><input id="auction_modification_rec" name="auction[modification_rec]"
size="30" type="text" value="" /></p>
<p><label for="auction_state">State</label><br /><input id="auction_state"
name="auction[state]" size="30" type="text" value="" /></p><input
name="commit" type="submit" value="Create" /></form>
I post the form data with the following calls:

params = urllib.urlencode({"auction[user]" :user,
"auction[auction_title]": auction_title,"auction[auction_url]": auction_url,
"auction[modification_rec]" :recommendation, "auction[state]=":
state,"commit":"Create"})

print "Storing...."
data = urllib.urlopen(self.baseUrl,params)
When I go and view the inserted record, the record exists, but the field
values are null. It is my thinking that the backend needs the "id" value
for each input value; how do I add that data to the urlencode() call?

When I utilize the above form, all is inserted and all of the field values
appear. What data am I not accounting for with my program; for its obvious
that the browser is sending something to the server that my application is
not.

Thanks.
Oct 2 '05 #1
2 2134
Joseph Chase wrote:
When I go and view the inserted record, the record exists, but the field
values are null. It is my thinking that the backend needs the "id" value
for each input value; how do I add that data to the urlencode() call?


since the id isn't part of the form data set:

http://www.w3.org/TR/REC-html40/inte...#form-data-set

that's a bit unlikely.

printing the params string might help you figure out what's
missing.

</F>

Oct 2 '05 #2
Fredrik Lundh wrote:
Joseph Chase wrote:

When I go and view the inserted record, the record exists, but the field
values are null. It is my thinking that the backend needs the "id" value
for each input value; how do I add that data to the urlencode() call?

since the id isn't part of the form data set:

http://www.w3.org/TR/REC-html40/inte...#form-data-set

that's a bit unlikely.

printing the params string might help you figure out what's
missing.


If there's no chance of putting any debug statements into the processing
script you might consider using a proxy or submitting to a local server
to ensure that you are submitting what you think.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Oct 2 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by someone | last post: by
3 posts views Thread by Doug Johnston | last post: by
6 posts views Thread by Henke | last post: by
4 posts views Thread by ree32 | last post: by
2 posts views Thread by albert | last post: by
1 post views Thread by mister-Ed | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.