🎨 POST -> GET for research form

This commit is contained in:
Florian Sylvain
2021-10-30 16:00:47 +02:00
parent 3bd46dddef
commit 6b474438f9
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -12,11 +12,11 @@
<body>
<?php
include("navbar.php");
if (isset($_POST['author'])) {
if (strlen($_POST['author']) < 3) {
if (isset($_GET['author'])) {
if (strlen($_GET['author']) < 3) {
echo "<p class='error'>Veuillez entrer 3 caractères minimum.</p>";
} else {
echo "<script>requestToApi('" . $_POST['author'] . "')</script>";
echo "<script>requestToApi('" . $_GET['author'] . "')</script>";
}
}
?>
+1 -1
View File
@@ -1,7 +1,7 @@
<header>
<nav class="navbar">
<h1>theses.fr</h1>
<form action="index.php" method="POST" class="navbar-input">
<form action="index.php" method="GET" class="navbar-input">
<input type="text" name="author" placeholder="nom auteur">
<button>
<img src="assets/search.svg" alt="search">