I have a problem in PHP when using $_POST['something'];.
I have two textboxes in an HTML body like this:
<form method="post">
<div class="style7">
Data Base username
<input name="uname" type="text" style="width: 136px" /></div>
</form>
<form method="post">
<div class="style7">
Password:<input name="pass" type="password" style="width: 202px" /></div>
</form>
I want to take the values from these textboxes so I am doing this:
<?php
$uname = $_POST['uname'];
$pass = $_POST['pass'];
echo $pass;
echo $uname;
?>
When I put a value only at the first textbox it prints only the first. The same happens when I put a value only on the second textbox. But, when I put values in each textbox at the same time and then hit Enter, it prints only the second value.
Is there a way to take the value from two HTML textboxes at the same time using PHP?
You need to put them in the same
<form>.