<!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>
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/Vi4Ei:1
Stack trace:
#0 {main}
thrown in /in/Vi4Ei on line 1
Process exited with code 255.
Output for 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/Vi4Ei on line 1
</body> </html>