Implement url check via AJAX
[infodrom.org/www.zeitungsliste.de] / lib / functions.inc
index 01c3a5f..c007edf 100644 (file)
@@ -429,6 +429,16 @@ function is_valid_url($url) {
   return true;
 }
 
+function ajax_check_url()
+{
+  global $POST;
+
+  if (!empty($_POST['url']) && is_valid_url($_POST['url']))
+    return true;
+
+  return false;
+}
+
 function sendmail($to, $name, $subject, $body, $header=array())
 {
   global $cfg;
@@ -495,4 +505,4 @@ function hits_inc($zeitung)
   db_query($query);
 }
 
-?>
\ No newline at end of file
+?>