include "i/links_db.inc"; if ($goto == "url" && $id != "") { if (link_selectfromid($id) && link_nextrow()) { $url = $link_row["url"]; header ("Location: $url\n"); /* Update hits and last access ip */ @link_update($id, $link_row["hits"], "$REMOTE_ADDR"); closedb(); } /* end if */ else { include ("i/error_url.html"); } /* end else */ closedb(); } /* end of url redirect */ else if ($goto == "new" && $submit != "yes") { include ("i/links_form.inc"); } /* end of new url */ else if ($goto=="new" && $submit=="yes") { $rc = link_insert("$new_title", "$new_url", "$new_type", "$new_posted_by", "$new_email"); if ($rc) { echo "
Your link has been added successfully!
"; echo "[back]"; } else if ($link_err != "") { include ("i/links_form.inc"); echo ""; } else { echo "Error: an error has occured during link insertion, please contact the webadmin.
"; } closedb(); } /* end submit */ else { if (link_selectall()) { echo "| title | posted by | on | hits | ||
| "; echo $i++; echo ". "; echo $link_row["title"]; echo " | "; if ($link_row["email"] != "") { echo ""; echo $link_row["posted_by"]; echo ""; } else echo $link_row["posted_by"]; echo " | "; echo date("M n, Y g:ia", $link_row["date"]); echo " | "; echo $link_row["hits"]; echo " | ||
| "; echo "add a new url: "; echo "[+]"; echo " | |||||