|
-
December 16th, 2007, 05:11 AM
#1
desktop application integration with php site
I want to write a desktop application that integrates with a web site(written in php),
- when the application is opened, the site can show this user is online
- User is able to send some request to another user
- e.g. user A press ‘request money’ user B is able to receive this requestuser B press ‘yes’ or ‘no’ to this request user A receive ‘yes’ or ‘no’ answer
- when someone post an article in the php site, user can be notified
I don't know where to start so i'm stucked. Can anyone give me a direction?
I'm wondering do i need to write a server that communicates with the php web site? or I can directly connect the desktop application to the php site?
-
December 16th, 2007, 12:33 PM
#2
Re: desktop application integration with php site
Well, it finally depends... But the simplest way could be a set of php pages the desktop app opens to register the user. Learn WinInet functions to perform GET/POST requests - and search the forum on the topic.
Regarding notifications. The web site special URL can be polled periodically, and information returned by php page back to poller can contain any information that can be interpreted by poller side.
Best regards,
Igor
-
December 16th, 2007, 01:48 PM
#3
Re: desktop application integration with php site
thanks,
i'm just thinking is polling wasting too much resources of the server,
i'm thinking using a persistent socket connection, but i don't know how to compare the two approaches, what do you think?
-
December 18th, 2007, 04:17 PM
#4
Re: desktop application integration with php site
Well, to do with persistent connections you must have some separate server process. Frankly, I don't know your requirements, so it's all up to you. As for me, a polling like twice a minute would be good enough for medium-level web application.
Best regards,
Igor
-
December 18th, 2007, 04:21 PM
#5
Re: desktop application integration with php site
i think you're right as my application isn't really require exact real-time, thanks.
Another question is that in every polling do i have to send the username and password to the server again for authentication? or there are other mechanism for verify after first login?
-
December 18th, 2007, 04:44 PM
#6
Re: desktop application integration with php site
Well, again, it depends. In case your server requires for some really strong protection, it would be good to use HTTPS protocol. And no, you never need to post a name/password each time you access the page - it would be enough to produce some uniquie id at the logon time on server side and use it during all session. Or maybe change it after every access and return it to desktop app in each reply.
Best regards,
Igor
-
December 18th, 2007, 05:08 PM
#7
Re: desktop application integration with php site
Do you have control over the server side app? In that case, I would suggest that the server pass back a cookie that the client return for each request. The cookie is a timestamp with a valid time period (1 hour for instance) for how long the login session may exist. The timestamp is encrypted and decrypted by the server---the client would just send it as a blob (but small).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|