0

Hi so i am a beginner and i am trying to submit a very basic form in a php file.

THE Problem :
Upon entering a name and pressing the submit button, it redirects me to a window which asks me to save the file locally Image of Save file locally window
Instead of giving output as: HI (name_entered)

MY code

<?php

if(isset($_GET["name"])){

   echo"HI". $_GET["name"];
    exit();
}
?>
<html>
    <body>
        <form action = "<?php $_PHP_SELF ?>" method="GET">
    Name:<input type="text" name="name" />
    <input type="submit"/>
    </form>
</body>
</html>

I have been trying to solve this for quite some time ... can someone please tell me where i am going wrong

  • The duplicate might not look like a perfect match, but the problem *is* the same (the PHP is being treated as a download/HTML doc instead of as PHP). – Quentin Feb 21 '22 at 15:57
  • 1
    Please [learn to love labels](http://www.456bereastreet.com/archive/200711/use_the_label_element_to_make_your_html_forms_accessible/) – Quentin Feb 21 '22 at 15:58

0 Answers0