Ich habe folgenden Code:
ich möchte nun hier irgendwie hinzufügen, dass wenn der Tabellenwert bei 'url' "http://" ist kein Duplication-Error entsteht:
PHP-Code:
$sql = mysql_query("SELECT * FROM {$prefix}pages WHERE url = '$url'");
if (mysql_num_rows($sql) > 0){
$error_duplication = true;
}else{
if (strlen($title) < 5 || strlen($title) > 100) { $error_variables = true; $errors["title"] = true; };
if (strlen($description) < 40 || strlen($description) > 500) { $error_variables = true; $errors["description"] = true; };
if (strlen($keywords) < 20 || strlen($keywords) > 200) { $error_variables = true; $errors["keywords"] = true; };
if (strlen($email) < 1 || strlen($email) > 200) { $error_variables = true; $errors["email"] = true; };
if (strlen($adresse) < 0 || strlen($adresse) > 200) { $error_variables = true; $errors["adresse"] = true; };
if (strlen($telefon) < 0 || strlen($telefon) > 30) { $error_variables = true; $errors["telefon"] = true; };
if (strlen($telefax) < 0 || strlen($telefax) > 30) { $error_variables = true; $errors["telefax"] = true; };
if (strlen($bild) < 0 || strlen($bild) > 200) { $error_variables = true; $errors["bild"] = true; };
if (strlen($url) < 0) { $error_variables = true; $errors["url"] = true; };
if (!$error_variables){
mysql_query("INSERT INTO {$prefix}pages (url,title,description,keywords,email, adresse, telefon, telefax, bild, accepted,ip,category) VALUES ('$url','$title','$description','$keywords','$email','$adresse','$telefon','$telefax','$bild','n','".getenv("REMOTE_ADDR")."',$c)");
};
PHP-Code:
$sql = mysql_query("SELECT * FROM {$prefix}pages WHERE url = '$url'");
if (mysql_num_rows($sql) > 0){
$error_duplication = true;
Kommentar