Hi community,i creating a simple website and description
i analyzed my code about 3days...2hours a day.
if i get the point in my head.then its say Website url is in use..but not..ok maybe i give the code below.
so if you can explain whats wrong.thanks
<?php
include_once ('connect.php');
$url= mysql_real_escape_string($_POST['url']);
$desc=mysql_real_escape_string($_POST['desc']);
if ($id == "krauti")
{
if (empty($_POST['url']) && empty($_POST['desc']))
{
die('<br><center>Both Empty!.<center/><br/>');
}
if (empty($_POST['url']))
{
die('<br><center>URL Empty!.<center/>');
}
if (empty($_POST['desc']))
{
die('<br><center>desc empty fill it!.<center/>');
}
$url = htmlspecialchars( stripslashes( strip_tags($_POST['url'] ) ) );
$aprasymas = htmlspecialchars( trim($_POST['desc'] ) );
$query = mysql_query("SELECT * FROM linkai WHERE url = '$url' AND 'desc' = '$desc'");
if( mysql_num_rows( $query ) == 1 ) {
"INSERT INTO linkai ".
"(id, url, desc) ".
"VALUES('','$_POST[url]','$_POST[desc]')";
echo "Yes!.";
}
else if (mysql_num_rows($query) == 0 ){
echo "No!!";
}
}
?>