Add exams from exam58 to exam98
This commit is contained in:
22
exam69/WorkingWithGET.php
Normal file
22
exam69/WorkingWithGET.php
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
<?php
|
||||
|
||||
if(isset($_GET['day']) && isset($_GET['date']) && isset($_GET['year'])){
|
||||
$day = $_GET['day'];
|
||||
$date = $_GET['date'];
|
||||
$year = $_GET['year'];
|
||||
if(!empty($day) && !empty($date) && !empty($year)){
|
||||
echo 'It is ' . $day . ' '. $date . $year;
|
||||
} else {
|
||||
echo 'Fill in all fields';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form action="WorkingWithGET.php" method="GET">
|
||||
Day: <br> <input type="text" name="day"><br>
|
||||
Date: <br> <input type="text" name="date"><br>
|
||||
Year: <br> <input type="text" name="year"><br><br>
|
||||
<input type="submit" value="submit">
|
||||
</form>
|
||||
26
exam69/WorkingWithPOST.php
Normal file
26
exam69/WorkingWithPOST.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
$match = 'pass123';
|
||||
|
||||
if(isset($_POST['password'])){
|
||||
$pass = $_POST['password'];
|
||||
if(!empty($pass)){
|
||||
if($pass == $match){
|
||||
echo 'Password is correct!';
|
||||
} else {
|
||||
echo 'Password is incorrect!';
|
||||
}
|
||||
|
||||
} else {
|
||||
echo 'Please enter the password!';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form action="WorkingWithPOST.php" method="POST">
|
||||
Password: <br> <input type="password" name="password"><br>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
Reference in New Issue
Block a user