Add exams from exam100 to exam150
This commit is contained in:
32
exam130/index.php
Normal file
32
exam130/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
require '/var/www/nikola/practice/exam110/connect.inc.php';
|
||||
|
||||
if (isset($_POST['search_name'])) {
|
||||
$search_name = $_POST['search_name'];
|
||||
if (!empty($search_name)) {
|
||||
|
||||
if (strlen($search_name) >= 4) {
|
||||
|
||||
$query = "SELECT `name` FROM `names` WHERE `name` LIKE '%" . mysqli_real_escape_string($con, $search_name) . "%'";
|
||||
$query_run = mysqli_query($con, $query);
|
||||
|
||||
$query_num_rows = mysqli_num_rows($query_run);
|
||||
if ($query_num_rows >= 1) {
|
||||
echo $query_num_rows . ' results found: <br>';
|
||||
while ($query_row = mysqli_fetch_assoc($query_run)) {
|
||||
echo $query_row['name'] . '<br>';
|
||||
}
|
||||
}
|
||||
} else{
|
||||
echo 'Your keyword must be 5 caracters or more';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="POST">
|
||||
Name: <input type="text" name="search_name">
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
Reference in New Issue
Block a user