You Are Here:

Community: Developer Discussion Boards

#1 Old HTTP response - 2008-06-25, 17:43

Join Date: Apr 2008
Posts: 18
darklord18
Offline
Registered User
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!
Reply With Quote

#2 Old Re: HTTP response - 2008-06-25, 18:08

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
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.
Reply With Quote

#3 Old Re: HTTP response - 2008-06-25, 18:13

Join Date: Apr 2008
Posts: 18
darklord18
Offline
Registered User
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
Reply With Quote

#4 Old Re: HTTP response - 2008-06-25, 18:22

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
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
Reply With Quote

#5 Old Re: HTTP response - 2008-06-25, 20:01

Join Date: May 2007
Posts: 2,737
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Online
Forum Nokia Champion
Quote:
Originally Posted by darklord18 View Post
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.
If you need writing the php script, then you are not at the right place.

Try http://forums.devnetwork.net/ or http://forums.devnetwork.net/ which are forums intended towards PHP discussions.


Quote:
Originally Posted by darklord18 View Post
I want a code so that you get the response from the webpage.

Make me know if am unclear!
Doesn't the following code work for you?

Code:
conn = httplib.HTTPConnection("www.myserver.com")
conn.request("POST", "/folder/myphp.php", params, headers)
response = conn.getresponse()
conn.close()
Best Regards,
Croozeus
Reply With Quote

#6 Old Re: HTTP response - 2008-06-25, 22:24

Join Date: Apr 2008
Posts: 18
darklord18
Offline
Registered User
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!
Reply With Quote

#7 Old Re: HTTP response - 2008-06-25, 22:58

Join Date: Mar 2008
Posts: 35
Location: Frankfurt, Germany
szallah
Offline
Registered User
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'
you could do the same without the string-module. that would be html.find('logged')... but i prefer the string-module...
Reply With Quote

#8 Old Re: HTTP response - 2008-06-25, 23:10

Join Date: Apr 2008
Posts: 18
darklord18
Offline
Registered User
THATS WHAT I NEEDED! THANK YOU TO YOU ALL FOR YOUR HELP! I WILL CHECK IT OUT!

THANKS A LOT!!
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ