Compare commits
No commits in common. "17c99c1e4c34b4ee29af6e527044afd89f8a1657" and "b1526d2b426cfd4866db0af7788ed2fb9bb310c6" have entirely different histories.
17c99c1e4c
...
b1526d2b42
16
Katalog.htm
16
Katalog.htm
|
@ -31,7 +31,7 @@ Das war die alte version. -->
|
|||
|
||||
<div class="Eingabe">
|
||||
<h2>Eingabe</h2>
|
||||
<form action="./php/catalogue_search.php" method="POST">
|
||||
<form action="/php/catalogue_search.php">
|
||||
<input type="text" name="Title" id="input" placeholder="Titel">
|
||||
<input type="text" name="Author" id="input" placeholder="Autor">
|
||||
<input type="text" name="Country" id="input" placeholder="Herkunft">
|
||||
|
@ -39,20 +39,10 @@ Das war die alte version. -->
|
|||
<input type="text" name="Language" id="input" placeholder="Sprache">
|
||||
<input type="number" name="Pages" id="input" placeholder="Seiten">
|
||||
<input type="date" name="Year" id="input" placeholder="Erscheinungsjahr"> <!-- Nur YYYY-->
|
||||
<input list="categories" name="Category" id="input" placeholder="Kategorie"> <!-- Nur Auswahl (per select?) -->
|
||||
<datalist id="categories">
|
||||
<option value="Buch">
|
||||
<option value="Magazin">
|
||||
<option value="E-Book">
|
||||
<option value="e-Magazin">
|
||||
</datalist>
|
||||
<input type="text" name="Category" id="input" placeholder="Kategorie"> <!-- Nur Auswahl (per select?) -->
|
||||
<input type="url" name="ImageLink" id="input" placeholder="Bild">
|
||||
<input type="number" name="LendTime" id="input" placeholder="Verteihdauer">
|
||||
<input list="types" name="LendType" id="input" placeholder="Verleihtyp">
|
||||
<datalist id="types">
|
||||
<option value="Physisch">
|
||||
<option value="Virtuell">
|
||||
</datalist>
|
||||
<input type="text" name="LendType" id="input" placeholder="Verleihtyp">
|
||||
<input type="submit" name="go" id="go">
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
<html>
|
||||
<body>
|
||||
<?php
|
||||
$form = array("Title"=>$_POST["Title"],"Author"=>$_POST["Author"]);
|
||||
$form = json_encode($form);
|
||||
echo $form
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
$form = array("Title"=>$_GET["Title"],array("Author"=>$_GET["Author"]);
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
echo json_encode($form);
|
||||
</body>
|
||||
</html>
|
||||
?>
|
|
@ -1,58 +0,0 @@
|
|||
<?php
|
||||
if(isset($_POST['link'])) {
|
||||
$link = $_POST['link'];
|
||||
|
||||
//remove protocol, we're assuming its http
|
||||
if(strstr($link, '://') != false){
|
||||
$link = substr($link, strpos($link,'://') + strlen('://'));
|
||||
}
|
||||
|
||||
//split the url into host (www.example.com) and requested page (index.php) on the first slash
|
||||
$host = substr($link, 0, strpos($link, '/'));
|
||||
$request = substr($link, strpos($link, '/'));
|
||||
|
||||
//open a socket connection to the site on port 80 (http protocol port)
|
||||
$fp = @fsockopen($host, 80, $errno, $errstr);
|
||||
|
||||
if($fp == false){
|
||||
$response = $errno . " " . $errstr;
|
||||
}
|
||||
else {
|
||||
//create the request headers
|
||||
$headers = array();
|
||||
$headers[] = 'HEAD ' . $request . ' HTTP/1.1';
|
||||
$headers[] = 'Host: ' . $host;
|
||||
$headers[] = 'Content-Length: 0';
|
||||
$headers[] = 'Connection: close';
|
||||
$headers[] = 'Content-Type: text/html';
|
||||
$headers = implode("\r\n", $headers) . "\r\n\r\n";
|
||||
|
||||
//send our request
|
||||
if (!fwrite($fp, $headers)) {
|
||||
fclose($fp);
|
||||
$response = "Could not access webpage specified.";
|
||||
}
|
||||
else {
|
||||
//read the response
|
||||
$rsp = '';
|
||||
while(!feof($fp)) { $rsp .= fgets($fp,8192); }
|
||||
fclose($fp);
|
||||
$hunks = explode("\r\n\r\n",trim($rsp));
|
||||
$headers = explode("\n", $hunks[count($hunks) - 1]);
|
||||
$response = trim($headers[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test Link</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php if(isset($response)) { echo $response; } ?>
|
||||
<form method="post">
|
||||
<label for="link">Link</label>
|
||||
<input id="link" type="text" name="link" />
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue