lamboman Posted May 30, 2011 Share Posted May 30, 2011 I have 3 images Shown below. What I want to do is add an onclick that will change another variable (lets call it $secondary). So when any one of these are clicked it will change the variable $secondary to whatever I want it to be. (hope that makes sence) <?php $main[0]="<img src='images/00.gif'>"; echo $main[0]; ?> <?php $main[1]="<img src='images/01.gif'>"; echo $main[1]; ?> <?php $main[2]="<img src='images/02.gif'>"; echo $main[2]; ?> Quote Link to comment https://forums.phpfreaks.com/topic/237879-varable-change-with-onclick/ Share on other sites More sharing options...
mikesta707 Posted May 30, 2011 Share Posted May 30, 2011 onclick is a client side event caught by client side languages like javascript. PHP can't do anything with an onclick event. Quote Link to comment https://forums.phpfreaks.com/topic/237879-varable-change-with-onclick/#findComment-1222382 Share on other sites More sharing options...
lamboman Posted May 30, 2011 Author Share Posted May 30, 2011 I figured as much, thanks Quote Link to comment https://forums.phpfreaks.com/topic/237879-varable-change-with-onclick/#findComment-1222385 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.