John Davidson

post - PHP $_POST returns empty only on one PC

0 comments
Message:


I have a simple form in my PHP project using POST method to send data. Everything works well on the most computers, but there is a strange problem on only one of them.
Imagine that this is my simple form:


<form action="controller/save.php" method="post">
<input type="text" name="username">
<input type="submit" value="show">
</form>

And this is my PHP file:


<?php  
print_r($_POST);
?>

In all cases, it returns an array containing the value of username variable. But only on one case, it returns


Array()

I have been never seen such behavior and unfortunately couldn't understand what is the issue. May you help me please?



My Answer:
html






_And this is my `process.php` file:_

php
if(isset($_POST['name'])){
$name = $_POST['name'];
echo "Hello, $name!";
} else {
echo "Name is not set!";
}
?>


_On most computers, when I submit the form, it correctly displays "Hello, [name]". However, on one specific PC, it always displays "Name is not set!". I have checked the form action URL, the form method, and the PHP code, but everything seems to be correct._

_Can anyone suggest what might be causing this issue on only one PC? Any help would be appreciated. Thank you!_

Rate this post

4 of 5 based on 8604 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us