| Reply | « Previous Thread | Next Thread » |
|
Hi everyone,
How do i get the response given by a php script?After i post the arguments to the website, it will return a response(from the echo command). How can I get this?? Thank you a lot! |
| darklord18 |
| View Public Profile |
| Find all posts by darklord18 |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi darkload18
you mean you want to make a event call using a php script or you want make that work take place in the web sever. please make the question very clear Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60
Last edited by gaba88 : 2008-06-25 at 18:14.
|
|
No i will send a set of variable. eg
server.php?username=asdas&pass=asd Now the php page will check if the username is good or not and will echo a reply. Either good or not. My problem is how to get this response? Check this code: http://www.mobilenin.com/pys60/resources/http_post.py I want a code so that you get the response from the webpage. Make me know if am unclear! Thank you! for you reply |
| darklord18 |
| View Public Profile |
| Find all posts by darklord18 |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi darkload18
what you can do is if you know php you can write a php script according to your problem. then to see the result or the response you can open that page using PyS60. i hope you got it. waiting for ur feedback Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Quote:
Try http://forums.devnetwork.net/ or http://forums.devnetwork.net/ which are forums intended towards PHP discussions. Quote:
Code:
conn = httplib.HTTPConnection("www.myserver.com")
conn.request("POST", "/folder/myphp.php", params, headers)
response = conn.getresponse()
conn.close()
Croozeus |
|
But the code:
response = conn.getresponse() Does not work! I wanted to get the response from the website!eg if the webpage displayed "logged", how can i get this. There is one way.To get the page(meaning download it). Is there not any better way? Thank you a lot! |
| darklord18 |
| View Public Profile |
| Find all posts by darklord18 |
|
this would be a workaround. maybe not really effective, but it works for me...
Code:
import urllib
import string
url = 'http://www.whateverserver.com/server.php?username=asdas&pass=asd'
data = urllib.urlopen(url)
html = data.read()
if string.find(html, 'logged') >= 0:
print 'logged in'
else:
print 'login failure'
|
|
THATS WHAT I NEEDED! THANK YOU TO YOU ALL FOR YOUR HELP! I WILL CHECK IT OUT!
THANKS A LOT!! |
| darklord18 |
| View Public Profile |
| Find all posts by darklord18 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| waiting for HTTP POST response | gemilib | General Symbian C++ | 3 | 2007-11-19 18:00 |
| Problem retreiving custom HTTP response header | hmeet2 | Symbian Networking & Messaging | 0 | 2007-01-03 10:35 |
| Receive uncomplete HTTP response | apitoman | Symbian Networking & Messaging | 6 | 2004-03-24 17:15 |
| How to handle a response with HTTP status code 100 (Continue)? | danieldkim | Mobile Java General | 5 | 2004-01-19 11:54 |
| nokia 7210 modem via IR doesn't work ! | oussamaaiadi | PC Suite API and PC Connectivity SDK | 1 | 2003-03-06 11:46 |