note 119757 deleted from index by cmb

From: Date: Fri, 19 Aug 2016 08:19:56 +0000
Subject: note 119757 deleted from index by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-206319@lists.php.net to get a copy of this message
Note Submitter: webtechhelp dot org at gmail dot com ---- Odd Even Number: <html> <body> <h3>Odd or Even PHP Example</h3> <form action="" method="post"> <label>Enter a number</label><input type="text" name="number" /> <input type="submit" /> </form> </body> </html> <?php if($_POST){ $number = $_POST['number']; //check if the enter value is a number or throw an error if (!(is_numeric($number) && is_int(0+$number))){ echo "<p style='color:red;'>Error: You entered a string. Please enter an Integer</p>"; die(); } //divide the entered number by 2 //if the reminder is 0 then the number is even otherwise the number is odd if(($number % 2) == 0){ echo "You entered an Even number"; }else{ echo "You entered an Odd number"; } } ?> http://webtechhelp.org

« previous php.notes (#206319) next »