Form handling in html5/php

I am trying to receive a very simple input through HTML and PHP using GET.

I can’t seem to get the variable from the form that I am using.

index.html:

<!DOCTYPE html>
<html>
<form action="track.php" method="get">
  input: <input type="text" name="input" required> <br>
  <input type="submit" value="Analyze">
</form>
</html>

track.php:

<!DOCTYPE html>
<html> 
<body>
	<?php echo $_GET["input"]; ?>
</body>
</html>

Repl: https://replit.com/@gabegad123/seedAnalysis

After I press submit, I don’t see anything. The problem seems to be around the “PHP echo” area of track.php, but I can’t see the problem. What am I doing wrong?

The issue is that you’ve made a front-end HTML, CSS & JS Repl. PHP is a server-side language and doesn’t actually run on the front-end. To use PHP, use the PHP Webserver template.

3 Likes