6 changed files with 118 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||
<?php |
|||
|
|||
function test_input($data) { |
|||
$data = trim($data); |
|||
$data = stripslashes($data); |
|||
$data = htmlspecialchars($data); |
|||
return $data; |
|||
} |
|||
|
|||
//$test = var_dump($_POST); |
|||
//echo $test; |
|||
|
|||
$name = $_POST["name"]; |
|||
$email = $_POST["email"]; |
|||
$rate = $_POST["rate"]; |
|||
$text = $_POST["text"]; |
|||
$date = date("H:i:s - d.m.Y"); |
|||
|
|||
$fname = "<h2>web: ".test_input($name)."</h2>"; |
|||
$femail = "<h3>od: ".test_input($email)."</h3>"; |
|||
$ftext = "<p>".test_input($text)."</p>"; |
|||
$fdate = "<h5>". $date ."</h5>"; |
|||
|
|||
$full = $fname . $femail . $ftext . $fdate . "<hr>"; |
|||
|
|||
$myfile = fopen("rating.txt","a") or die("Nelze otevřít"); |
|||
|
|||
fwrite($myfile, $full); |
|||
fclose($myfile); |
|||
|
|||
header("Location: /list.php"); |
@ -0,0 +1,31 @@ |
|||
<?php |
|||
$title = "Formulář hodnocení webů" |
|||
?> |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title><?php echo $title; ?></title> |
|||
</head> |
|||
<body> |
|||
<h1><?php echo $title; ?></h1> |
|||
|
|||
<?php include("menu.php"); ?> |
|||
|
|||
<form action="action_form.php" method="post"> |
|||
<input type="text" name="name" id="name" placeholder="jméno webu"> <br> |
|||
<input type="email" name="email" id="email" placeholder="email hodnotícího"><br> |
|||
<label for="rate">Hodnoceni</label> |
|||
<input type="range" name="rate" id="rate" min="0" max="5" step="0.5"><br> |
|||
<textarea name="text" id="text" cols="30" rows="10" placeholder="zpráva"></textarea><br> |
|||
<input type="submit" value="Odeslat hodnocení"> |
|||
</form> |
|||
|
|||
<hr> |
|||
<div> |
|||
Škrabánek @ 2022y |
|||
</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,24 @@ |
|||
<?php |
|||
$title = "Web Hodnocení webu" |
|||
?> |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title><?php echo $title; ?></title> |
|||
</head> |
|||
<body> |
|||
<h1><?php echo $title; ?></h1> |
|||
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Asperiores, placeat! Veritatis soluta praesentium repudiandae error. Perspiciatis suscipit dolor repellendus voluptatem vitae quisquam cum odio, inventore atque minus quaerat hic earum? |
|||
</p> |
|||
|
|||
<?php include("menu.php"); ?> |
|||
|
|||
<hr> |
|||
<div> |
|||
Škrabánek @ 2022 |
|||
</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,26 @@ |
|||
<?php |
|||
$title = "List hodnocení" |
|||
?> |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title><?php echo $title; ?></title> |
|||
</head> |
|||
<body> |
|||
<h1><?php echo $title; ?></h1> |
|||
<?php include("menu.php"); ?> |
|||
<?php |
|||
$myfile = fopen("rating.txt","r"); |
|||
echo fread($myfile,filesize("rating.txt")); |
|||
fclose($myfile); |
|||
|
|||
?> |
|||
<hr> |
|||
<div class="footer"> |
|||
Škrabánek @ 2022y |
|||
</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,5 @@ |
|||
<div> |
|||
<a href="/"><button>HOME</button></a> |
|||
<a href="form.php"><button>FORMULÁŘ</button></a> |
|||
<a href="list.php"><button>LIST</button></a> |
|||
</div> |
@ -0,0 +1 @@ |
|||
<h2>web: google.com</h2><h3>od: g@man.com</h3><p>Velmi hezké</p><h5>08:39:06 - 26.01.2023</h5><hr><h2>web: Jmeno Prijmeni</h2><h3>od: lobem57394@falkyz.com</h3><p>lorem</p><h5>08:56:38 - 26.01.2023</h5><hr><h2>web: asd</h2><h3>od: lobem57394@falkyz.com</h3><p>qwe</p><h5>08:59:50 - 26.01.2023</h5><hr><h2>web: asd</h2><h3>od: lobem57394@falkyz.com</h3><p>qwe</p><h5>08:59:57 - 26.01.2023</h5><hr> |
Loading…
Reference in new issue