Alconsolync
New Member
I would like to give the user the choice to choose between 'yes' or 'no' as answer on a given question. If the user for example clicks 'yes' i would like to give a variable thats called, let's say; $value the value 'yes' and vice versa if user clicks 'no'.The problem is I don't know how to make a text string clickable and to only give the variable a value when the string is clicked.My thought was to do something like this but as I have come to understand this probably isn't the way to do it? \[code\]<h1><a href="http://stackoverflow.com/questions/15624890/yes.php" onclick="<?php global $value; $value='http://stackoverflow.com/questions/15624890/YES'; ?>">YES</a><a href="http://stackoverflow.com/questions/15624890/yes.php" onclick="<?php global $value; $value='http://stackoverflow.com/questions/15624890/NO'; ?>">NO</a></h1><?php global $value; $answer=getDbInfo('Answer'); if($value=http://stackoverflow.com/questions/15624890/=$answer){ echo'Correct'; }else{echo 'Incorrect';}?>\[/code\]Thanks in advance for your help guys!