execute php on link click

Discussion in 'Web Design and Development' started by jordanste, Apr 14, 2008.

  1. jordanste macrumors member

    Joined:
    Feb 25, 2006
    #1
    hey folks, i was wondering if there was an easy way to execute some php on a link click, without a form. for example, if i wanted to delete a row in mysql by clicking a link. i have done some mild searching around for an answer to this and come up blank. im most likely thinking about it too hard, there is probably a really simple solution that im overlooking. let me know if you can help.
     
  2. mac-convert macrumors 6502a

    mac-convert

    Joined:
    Nov 2, 2006
    Location:
    Are we there yet?
    #2
    I don't specifically know how to do this, but I can guide you to something that may shed some light on it.

    phpMyAdmin is a very popular program for the care and feeding of mysql installations, and it's an open source program. Google it for their web site, download it and take a look.

    Hope this helps...
     
  3. FalcorTheDog macrumors member

    Joined:
    Jun 17, 2005
    #3
    Just link to another PHP page and at the top of that page insert some PHP/MySQL to delete the row you want.

    If you want to delete rows without the user leaving the page, you'll have to look into AJAX.
     
  4. Darran macrumors member

    Joined:
    Mar 31, 2008
    Location:
    Singapore
    #4
    It is pretty easy actually.

    You could put up a delete link such as deleteuser.php?id=3 where 3 is the id of the row you want to delete. Do note that such method has a huge flaw though, people could just change the id and they can delete another user. If you are going to be using this method, make sure that you have backed it up with strong security.
     

Share This Page