Getting a rollover image to execute php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rlm51
    New Member
    • Mar 2007
    • 29

    Getting a rollover image to execute php

    Hi everyone ... Hope you are all well ...

    I have a rollover image button that I need to do several things:
    1. Update a variable: <?PHP $VarNum = $VarNum + 1 ?>
    2. Open a pdf file: <a href="Catalog.p df"
    - and if possible -
    3. Update a database variable: <?PHP mysql_query("UP DATE tableA SET M = $VarNum"); ?>

    All on one click ... Could someone please give me an idea of the syntax.

    Thanks

    Robert
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    PHP will not work for rollover things nor buttons like you want... You will need Javascript or AJAX.

    PHP is server side, which means that it is only done when the page is requested. Once the page has been requested it cannot change, so PHP variables are only available while the server is outputting the page. The only way to change a PHP variable would be to refresh the page by sending a command to itself. I don't recommend this and encourage you to look into javascript.

    Comment

    Working...