<form method='get' action='y.php'>
<div>
<input type='text' id='txtName' name='txtName'/>
<input type='submit' value='submit' id='submit'/>
</div>
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
if (isset($_GET['btnSave'])) {
$name=isset(($_GET['txtName'])?isset($_GET['txtName']:'');
//then Logic of insert goes here
}
}
?>
so before moving to y.php
the record must be saved.
but I cant get the $name
value, as action given to y.php
.
How can I get $name
which contain value in text box.
if you change the action to this (same/current) page record is going to database without any flaw or error.