I have a text box in that if user enters a value it will go to db and check that value =y if so it has give an alert to user like would you like to activa if ok it should rediredc to other page if no also redirect to some page. Alert box should have yes or no
Ben sql komut dosyası yanlış veya java script olup olmadığını bilmiyorum
$activate = mysql_query("SELECT * FROM `thirdpartycategorymaster` WHERE `delete` = 'y' ");
$activate='y';
if($activate)
{
header("location:catact.php");
}
else
{
$activate='NULL';
header("location:tp_home.php");
}
$checkformembers = mysql_query("SELECT * FROM thirdpartycategorymaster WHERE ThirdPartyCategoryName = '$ThirdPartyCategoryName'");
$no=0;
if ($ThirdPartyCategoryName)
{
if(mysql_num_rows($checkformembers) != 0)
{
header('location:newcat.php?msg=category exists');
}
else
{
$sql="INSERT INTO thirdpartycategorymaster (ThirdPartyCategoryID, ThirdPartyCategoryName)
VALUES
('$_POST[ThirdPartyCategoryID]',
'$_POST[ThirdPartyCategoryName]'
)";
$no=1;
header('location:tp_home.php?add=Category Added Successfully');
}
if (!mysql_query($sql,$conn))
{
die('Error: ' . mysql_error());
}
}
else
header('location:tp_home.php');
/*if ($no==1)
header("Location:tp_home.php?msg=Category Added Successfully");
else
header("Location:tp_home.php");
*/
mysql_close($conn);