hello
I am facing a problem while creating a a code
I need to add 3 validations into this code
validations are s follow
1. check if a url address already exist into database then give an error i.e.
URL address already exist in database 2. check if title row of the database is blank(unable to detect by function it gives error i.e.
We cannot add this url because we are unable to detect its title 3. check if url contains https:// protocol it give error i.e.
You are not allowed to add https:// URLs
My php code is
$sql="INSERT INTO $tbl_name(webname, urladdr)VALUES('$title', '$webname')";
$result=mysql_query($sql);
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='index.php'>Back to main page</a>";
}
else {
echo "ERROR";
}
$tbl_name is weblist (which I already defined in function)
webname, urladdr are rows in that table
$title is a website title detected by the function
$webname is the URL address of the website
Please solve my problem as soon as possible