如何将表格数据发布到ASP页面? [英] how-to POST form data to ASP pages?

查看:79
本文介绍了如何将表格数据发布到ASP页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将表单数据发布到页面上看起来像这样的ASP页面

本身......


< form method =' 'POST''>< input src = \icons\devices\coffee-on.gif type =''image''

align =''absmiddle''width = 16 height = 16 title =''关闭''><输入类型=''隐藏''

value =''图像''name =''动作''><输入类型= ''hidden''value =''hs.ExecX10ByName

" Kitchen Espresso Machine"," Off",100''>< / form>


我一直在尝试这个,但是我收到语法错误...

params = urllib.urlencode({''hidden'':''hs.ExecX10ByName" Kitchen

Espresso Machine"," On",100''})

urllib.urlopen(" http://192.168.1.11:80 / hact / kitchen.asp" ;,params)


有人可以帮忙并确认我是在正确/错误的轨道上并帮助

语法?


谢谢!

I need to post form data to an ASP page that looks like this on the page
itself...

<form method=''POST''><input src=\icons\devices\coffee-on.gif type=''image''
align=''absmiddle'' width=16 height=16 title=''Off''><input type=''hidden''
value=''Image'' name=''Action''><input type=''hidden'' value=''hs.ExecX10ByName
"Kitchen Espresso Machine", "Off", 100''></form>

I''ve been trying this but I get a syntax error...
params = urllib.urlencode({''hidden'': ''hs.ExecX10ByName "Kitchen
Espresso Machine", "On", 100''})
urllib.urlopen("http://192.168.1.11:80/hact/kitchen.asp", params)

Can someone help out and validate I''m on the right/wrong track and help with
the syntax?

thanks!


推荐答案

" livin" <活着@@ cox.net>写道:
"livin" <livin@@cox.net> writes:
我需要将表单数据发布到页面上看起来像这样的ASP页面
< form method =''POST''> ;< input src = \icons\devices\coffee-on.gif type =''image''
align =''absmiddle''width = 16 height = 16 title =''Off'' >< input type =''hidden''
value =''''''''=' br&>厨房浓缩咖啡机,关闭,100''>< / form>
我一直在尝试这个但是我收到语法错误...
params = urllib.urlencode({''hidden'':''hs.ExecX10ByName" Kitchen
Espresso Machine"," On",100''})
urllib.urlopen(" http: //192.168.1.11:80/hact/kitchen.asp" ;, params)
I need to post form data to an ASP page that looks like this on the page
itself...
<form method=''POST''><input src=\icons\devices\coffee-on.gif type=''image''
align=''absmiddle'' width=16 height=16 title=''Off''><input type=''hidden''
value=''Image'' name=''Action''><input type=''hidden'' value=''hs.ExecX10ByName
"Kitchen Espresso Machine", "Off", 100''></form>
I''ve been trying this but I get a syntax error...
params = urllib.urlencode({''hidden'': ''hs.ExecX10ByName "Kitchen
Espresso Machine", "On", 100''})
urllib.urlopen("http://192.168.1.11:80/hact/kitchen.asp", params)




urlencode不关心输入元素的类型(或者

页面i s ASP),只是名称/值对。你想:


params = urllib.urlencode({''Action'':''Image'',...})


提供的HTML没有说明第二个隐藏输入的名称是什么
字段是什么。在这种情况下,在

中应该传递给服务器的内容一点也不清楚。


看起来你试图打破一个字符串行边界,但

可能是您的发布软件。如果你这样做了,那就是'

生成一个语法错误,并且你应该尝试阅读教程,这是一个很好的迹象。




< mike

-

Mike Meyer< mw*@mired.org> http://www.mired.org/home/mwm/

独立的WWW / Perforce / FreeBSD / Unix顾问,电子邮件以获取更多信息。



urlencode doesn''t care about the type of the input element (or that
the page is ASP), just the name/value pairs. You want:

params = urllib.urlencode({''Action'': ''Image'', ...})

The provided HTML doesn''t say what the name of the second hidden input
field is. It''s not at all clear what should be passed to the server in
this case.

It looks like you tried to break a string across a line boundary, but
that may be your posting software. If you did, then that''s what''s
generating a syntax error, and a good indication that you should try
reading the tutorial.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


Mike,

我很欣赏帮助......我是Python的noobie。我知道vbscript& jscript

但没有别的。


我显然不需要提交图像


我的代码看起来像这个但它不起作用......任何想法?

params = urllib.urlencode({''action'':''hs.ExecX10ByName" Kitchen

浓咖啡机器,关闭,100''})

urllib.urlopen(" http://192.168.1.11:80 / hact / kitchen.asp",params)


" Mike Meyer" < mw*@mired.org>在消息中写道

news:86 ************ @ bhuda.mired.org ...
Mike,
I appreciate the help... I''m a noobie to Python. I know vbscript & jscript
but nothing else.

I obviously do not need to submit the images

my code looks like this but it is not working... any ideas?
params = urllib.urlencode({''action'': ''hs.ExecX10ByName "Kitchen
Espresso Machine", "Off", 100''})
urllib.urlopen("http://192.168.1.11:80/hact/kitchen.asp", params)

"Mike Meyer" <mw*@mired.org> wrote in message
news:86************@bhuda.mired.org...
" livin" <活着@@ cox.net>写道:
"livin" <livin@@cox.net> writes:
我需要将表单数据发布到页面上看起来像这样的ASP页面
< form method =''POST''> ;< input src = \icons\devices\coffee-on.gif type =''image''
align =''absmiddle''width = 16 height = 16 title =''Off'' >< input type =''hidden''
value =''''''''=' br&>厨房浓缩咖啡机,关闭,100''>< / form>
我一直在尝试这个但是我收到语法错误...
params = urllib.urlencode({''hidden'':''hs.ExecX10ByName" Kitchen
Espresso Machine"," On",100''})
urllib.urlopen(" http: //192.168.1.11:80/hact/kitchen.asp" ;, params)
I need to post form data to an ASP page that looks like this on the page
itself...
<form method=''POST''><input src=\icons\devices\coffee-on.gif type=''image''
align=''absmiddle'' width=16 height=16 title=''Off''><input type=''hidden''
value=''Image'' name=''Action''><input type=''hidden'' value=''hs.ExecX10ByName
"Kitchen Espresso Machine", "Off", 100''></form>
I''ve been trying this but I get a syntax error...
params = urllib.urlencode({''hidden'': ''hs.ExecX10ByName "Kitchen
Espresso Machine", "On", 100''})
urllib.urlopen("http://192.168.1.11:80/hact/kitchen.asp", params)



urlencode并不关心输入元素的类型(或者
页面是ASP),jus名称/值对。你想要:

params = urllib.urlencode({''Action'':''Image'',...})

提供的HTML不会说出第二个隐藏输入字段的名称是什么。在这种情况下,应该传递给服务器的内容一点也不清楚。

看起来你试图在一个线边界上打破一个字符串,但是
这可能是你的发布软件。如果你这样做了,那就是产生语法错误的原因,以及你应该尝试阅读教程的好迹象。

< mike
-
Mike Meyer< mw*@mired.org> http://www.mired.org/home/mwm/ <独立的WWW / Perforce / FreeBSD / Unix顾问,电子邮件以获取更多信息。



urlencode doesn''t care about the type of the input element (or that
the page is ASP), just the name/value pairs. You want:

params = urllib.urlencode({''Action'': ''Image'', ...})

The provided HTML doesn''t say what the name of the second hidden input
field is. It''s not at all clear what should be passed to the server in
this case.

It looks like you tried to break a string across a line boundary, but
that may be your posting software. If you did, then that''s what''s
generating a syntax error, and a good indication that you should try
reading the tutorial.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more
information.



" livin" <活着@@ cox.net>写道:
"livin" <livin@@cox.net> writes:
迈克,
我很感激帮助...我是Python的诺言。我知道vbscript& jscript
但没有别的。

我显然不需要提交图像

我的代码看起来像这样但它不起作用......有什么想法吗?

params = urllib.urlencode({''action'':''hs.ExecX10ByName" Kitchen
Espresso Machine"," Off",100''}) urllib.urlopen(" http://192.168.1.11:80 / hact / kitchen.asp",params)
Mike,
I appreciate the help... I''m a noobie to Python. I know vbscript & jscript
but nothing else.

I obviously do not need to submit the images

my code looks like this but it is not working... any ideas?
params = urllib.urlencode({''action'': ''hs.ExecX10ByName "Kitchen
Espresso Machine", "Off", 100''})
urllib.urlopen("http://192.168.1.11:80/hact/kitchen.asp", params)




没有想法。什么是不工作意思?你有从
Python的回溯吗?如果是这样,分享它 - 因为我在这里看到的不是合法的Python。从

你从kitchen.asp表单处理程序得到一条错误消息?如果是这样的话,

....


< mike

-

Mike Meyer < mw*@mired.org> http://www.mired.org/home/mwm/

独立的WWW / Perforce / FreeBSD / Unix顾问,电子邮件以获取更多信息。



No ideas. What does "not working" mean? Do you get a traceback from
Python? If so, share it - cause what I see here isn''t legal Python. Do
you get an error message from the kitchen.asp form handler? If so,
....

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


这篇关于如何将表格数据发布到ASP页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆