28 lines
612 B
PHP
28 lines
612 B
PHP
<html>
|
|
<head>
|
|
|
|
</head>
|
|
<main>
|
|
<form action="index.php" method="post">
|
|
Name: <input type="text" name="linkName"> URL: <input type="text" name="linkUrl"> <input type="Submit" value="Speichern">
|
|
</form>
|
|
</main>
|
|
</html>
|
|
|
|
|
|
<?php
|
|
include ('link.php');
|
|
|
|
$db = new dbLinkHAndler();
|
|
|
|
if ($_POST["linkName"] != "" AND $_POST["linkUrl"] != "")
|
|
{
|
|
$link1=new Link($_POST["linkName"], $_POST["linkUrl"]);
|
|
$db->saveLink($link1);
|
|
}
|
|
|
|
foreach ($db->getListReverse() as $link)
|
|
{
|
|
echo $link['link_id'].': <a href="'.$link['link_url'].'" target="_blank">'.$link['link_name'].'</a><br>';
|
|
}
|
|
?>
|