I need to ask a user a question on a webpage to see whether they want something added to a database, by giving them a yes or no question. If they type yes they item will be added if they press no it won’t. How can i do this?
Thanks In Advance
<i> </i><form action="confirm.php" method="POST"> <input type="text" name="conformation" /> </form>
[code=php] <?php $string=$_POST['conformation']; if($string=="yes") { //add to db } else{ //do nothing } ?> [/code]
[code=php] <? $variable=$_POST['formanswer']; if($variable=="yes") { //do your code for database addition } else { "exit"; } ?> [/code]
Help @Hibbert spread the word by sharing this article on Twitter...