/ Published in: PHP
Simple as pie and chips...
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php { $task = $_POST['calculate']; { echo 'Fuck you, you dirty little cunt!'; } else { switch($task) { case 'add': echo $sum1 . ' + ' . $sum2 . ' = ' . $sum1 + $sum2; break; case 'multiply': echo $sum1 . ' x ' . $sum2 . ' = ' . $sum1 * $sum2; break; case 'subtract': echo $sum1 . ' - ' . $sum2 . ' = ' . $sum1 - $sum2; break; default: echo 'Get fucked!'; break; } } } ?> <form method="post" action="#"> <p> <label>First Number: </label> <input type="text" name="sum1" value="" /> </p> <p> <select name='calculate'> <option value='null'>Choose...</option> <option value='add'>+</option> <option value='multiply'>x</option> <option value='subtract'>-</option> </select> </p> <p> <label>Second Number: </label> <input type="text" name="sum2" value="" /> </p> <p> <input type="submit" name="submit" value="Calculate" /> </p> </form>