3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<html> <body> <style> .error{ color: red; } </style> </body> </html> <?php $NAME = $EMAIL = $MESSAGE = ""; $NAMERR = $EMAILRR = $MESSAGERR = ""; if($_SERVER["REQUEST_METHOD"] == "POST"){ if(!empty($_POST["NAME"])){ $NAME = Code($_POST["NAME"]); } else{ $NAMERR = "Please Enter Name"; } if(!empty($_POST["EMAIL"])){ $NAME = Code($_POST["EMAIL"]); } else{ $EMAILRR = "Please Enter Email"; } if(!empty($_POST["MESSAGE"])){ $NAME = Code($_POST["MESSAGE"]); } else{ $MESSAGERR = "Please Enter Message"; } } function Code($Code){ $Code = htmlspecialchars($Code); $Code = trim($Code); $Code = stripslashes($Code); return $Code; } ?> <form method="post" action=" <?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <p> <span class="error">*<?php echo $NAMERR;?></span> Name: <br> <input type="text" name="NAME"> <br> <br> <span class="error">*<?php echo $EMAILRR;?></span> Email: <br> <input type="email" name="EMAIL"> <br> <br> <span class="error">*<?php echo $MESSAGERR;?></span> Message: <br> <textarea name="MESSAGE" rows="5" colls="40"></textarea> <br> <br> <input type="submit" name="submit" value="Send"> </p> </form> <?php echo $NAME; echo "<br>"; echo $EMAIL; echo "<br>"; echo $MESSAGE; ?>