<?php
if(isset($_POST['sub']))
{
$mname=$_POST['sub'];
}
if(isset($_POST['pos']))
{
$pos=$_POST['pos'];
}
if(isset($_POST['rad1']))
{
$vis=$_POST['rad1'];
}
?>
<?php
global $mname, $pos, $vis;
if(isset($mname) && isset($pos) && isset($vis))
{
$q= "INSERT INTO subjects (menu_name, position, visible) VALUES ('$mname', $pos, $vis) ";
$qs=mysql_query($q, $connection);
if($qs)
{ echo "hi";
header("Location: content.php");
}
else{
echo mysql_error();
}
}
?>
- There is a form which is posting 'sub', 'pos' 'rad1'
- its getting stuck at http://localhost/widget_corp/create_subject.php?sub=whatever&pos=4&rad1=1
- Its adding nothing to the database, but the id is getting auto incremented.
Why isn't it redirecting to content.php?