Jump to content


Photo

Mimic Javascripts onclick


  • Please log in to reply
2 replies to this topic

#1 webdogjcn

webdogjcn
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 17 May 2006 - 09:44 PM

I want a user to simply click a button and it will modify a value within a database. So I though of this:
<a href='' onclick="<?php etc. ?>"><img src='' border=0></a>

Now, I understand that PHP is server side and Javascript is client side, but is there someway to mimic this function with PHP or pass the information from client side to a server side php script? I know it can be done because I've seen similar things on other websites.

#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 17 May 2006 - 10:26 PM

if you don't mind the page to be reloaded, then you can just create a url with the appropriate query string and then redirects back to the same page. if you don't like the page to reload, you can try AJAX, or open a new window that does this and then closes itself when done.
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 webdogjcn

webdogjcn
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 17 May 2006 - 10:53 PM

wow, I didn't think of that...thanks so much




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users