Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

the return from the form doest appeare in the backend side of my code

I am wokring on a small project to learn more about the request methods on PHP. In which I take the value from a user input and do text transformation on it, then return it to the user.
html

`<form action="index.php"    method="GET">
<input type="text" placeholder="Enter name" name="name"/>
<input type="submit" value="Go" name="submit"/>
</form>`

php

`<?php
if(isset($_POST["submit"])){
$name=$_POST["name"];
$result = strtoupper($name);
echo $result;
}
?>`

when i click on submit nothing happens. I checkedvar_dump($_POST),but also return nothing. what i did wrong?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I did a check on the _POST array but i coudnt find the value

>Solution :

You form request is going through GET method and not POST. Change your form method from this method="GET" to this method="POST".

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading