Links Database

init(); CDatabase::setMain($db); if (isset($_GET['action']) ? $action = $_GET['action'] : $action = ""); if (isset($_POST['action'])) $action = $_POST['action']; if (isset($_GET['no_link']) ? $no_link = $_GET['no_link'] : $no_link = ""); switch ($action) { case "add": ?>

You can use this form to submit a link to be added to the links database. Here are a few guidelines about the process:

Add a website to the links database
Site name:
Site URL:
Description:
Link button (if any):
A website name must be entered!"; if (empty($url)) $msg_err .= "
  • A URL must be entered!
  • "; //If the data is incomplete, stop the save if ($msg_err != "") { echo "

    Your link submission failed for the following reasons:

    Correct the error(s), then try again.

    "; } else { $date = time(); //Only add the link if it's a valid submission if ($_SERVER['REQUEST_METHOD'] == "POST" && ( strpos($_SERVER['HTTP_REFERER'], "http://www.interordi.com") !== false || strpos($_SERVER['HTTP_REFERER'], "http://interordi.com") !== false )) { //Save the link submission $query = "INSERT INTO links (name, url, description, logo, date) VALUES ('$name', '$url', '$description', '$logo', '$date')"; $result = CDatabase::main()->query($query); } echo "

    The link has been submitted. I will check it out, then add it to the proper category if it isn't listed already. Thanks!

    "; } break; case "report": //Stop if no link number is given if (!isset($no_link) || empty($no_link)) { echo "

    An error has occured!

    "; exit; } echo "

    You can report a broken link or a site move here. Please only press the button below if the site is no longer available, or if it changed of URL!

    "; break; case "reportsave": if (is_numeric($_GET['no_link']) ? $no_link = $_GET['no_link'] : $no_link = ""); //Stop if no link number is given if (!isset($no_link) || empty($no_link)) { echo "

    An error has occured!

    "; exit; } //Put a report mark for the site $query = "UPDATE links SET report = 1 WHERE no_link = '$no_link'"; $result = CDatabase::main()->query($query); echo "

    The site has been reported, so I will give it a look. Thank you!

    "; break; } ?>