Jump to content

Mimic Javascripts onclick


webdogjcn

Recommended Posts

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

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.