PDA

Click to See Complete Forum and Search --> : running PHP during onClick


sql_lall
Aug 7th, 2005, 08:35 AM
I've made an rss aggregator using PHP, which can tell people when certain feeds they are watching have been updated. I provide a page where they can mark feeds as 'seen', and also provide links to the sites related to each feed.
Many users however have been asking for the status of their feeds to be updateed whenever they click on the link. Is this possible in php?
I was thinking there may be some way to intercept the <a href> click, possibly using JavaScript, so that when it was followed the php update function was called...however, I have no idea whether it is possible to mix the two languages like this, as one is client-side and one is server-side.
Even, would it be possible to send a request when the link is followed, to the server giving it the information required (in this case, two integers) so it can perform a php script while not opening any new windows?
Thanks

PlaGuE
Aug 7th, 2005, 07:02 PM
JavaScript and PHP are combinable...

But it would seem like you would have to do frames or... a popup window...

At least in my way of thinking....

Pc_Madness
Aug 7th, 2005, 10:38 PM
Use a hidden iframe and javascript. Pass the numbers to iframe, tell it to goto a certain page via javascript, do whatever it is that your trying to do with your php page, and then return perhaps a javascript function inside the iframe that will update/notify the user (don't really know anything about RSS so...)

If the user is navigating away from the page when they click the link....creater a wrapper perhaps around urls, give each address a unique id, call a php page that will convert the url to an address and do your 'updating'.

Sorry, not really sure how RSS works :(