webdogjcn Posted May 17, 2006 Share Posted May 17, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/9882-mimic-javascripts-onclick/ Share on other sites More sharing options...
ryanlwh Posted May 17, 2006 Share Posted May 17, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/9882-mimic-javascripts-onclick/#findComment-36748 Share on other sites More sharing options...
webdogjcn Posted May 17, 2006 Author Share Posted May 17, 2006 wow, I didn't think of that...thanks so much Quote Link to comment https://forums.phpfreaks.com/topic/9882-mimic-javascripts-onclick/#findComment-36751 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.