<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <form method='POST'> <h2>Please input your name:</h2> <input type="text" name="name"> <input type="submit" value="Submit Name"> </form> <?php //Retrieve name from query string and store to a local variable $name = $_POST['name']; echo "<h3> Hello $name </h3>"; ?> </body> </html>- See more at: http://www.w3resource.com/php-exercises/php-basic-exercises.php#EDITOR
Output for 8.0.13
<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <form method='POST'> <h2>Please input your name:</h2> <input type="text" name="name"> <input type="submit" value="Submit Name"> </form>
Fatal error: Uncaught Error: Undefined constant "php " in /in/IIR7U:1
Stack trace:
#0 {main}
thrown in /in/IIR7U on line 1
Process exited with code 255.
Output for 7.2.0 - 7.2.6, 7.3.32 - 7.3.33, 7.4.33
<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <form method='POST'> <h2>Please input your name:</h2> <input type="text" name="name"> <input type="submit" value="Submit Name"> </form>
Warning: Use of undefined constant php - assumed 'php ' (this will throw an Error in a future version of PHP) in /in/IIR7U on line 1
</body> </html>- See more at: http://www.w3resource.com/php-exercises/php-basic-exercises.php#EDITOR