odetron Posted February 11, 2007 Share Posted February 11, 2007 Lets say i have the text [1] and i whant it to change a variable when clicked on. so variable $i would be changed from 1 to 2. How do i do this? Link to comment https://forums.phpfreaks.com/topic/38053-changeing-variable-when-something-is-clicked/ Share on other sites More sharing options...
Jessica Posted February 11, 2007 Share Posted February 11, 2007 If you want it to happen without leaving the page, javascript. Link to comment https://forums.phpfreaks.com/topic/38053-changeing-variable-when-something-is-clicked/#findComment-182166 Share on other sites More sharing options...
The Bat Posted February 11, 2007 Share Posted February 11, 2007 You could also possibly use $_GET. Link: <a href="yourpage.php?changevar=true">Change the variable!</a> Code on yourpage.php: $i = 1; if ($_GET['changevar'] == true) { $i = 2; // Other actions... } Link to comment https://forums.phpfreaks.com/topic/38053-changeing-variable-when-something-is-clicked/#findComment-182168 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.