Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!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>Faris Rasyid | 50421483</title>
- </head>
- <body>
- <h1>Cari Lokasi Universitas</h1>
- <form action="hasil.php" method="GET">
- <fieldset>
- <label for="university">Masukkan nama universitas:</label>
- <input type="text" id="university" name="university" required><br><br>
- </fieldset>
- <input type="submit" value="Cari Lokasi">
- </form>
- </body>
- </html>
- //
- <?php
- echo "<h1>Lokasi Universitas</h1>";
- if ($_SERVER["REQUEST_METHOD"] == "GET") {
- $university = $_GET['university'];
- $lokasi = "";
- if ($university == "gundar" || $university == "universitas gunadarma") {
- $lokasi = "Depok";
- } elseif ($university == "ui" || $university == "universitas indonesia") {
- $lokasi = "Depok";
- } elseif ($university == "gunadarma" || $university == "universitas indonesia") {
- $lokasi = "Depok";
- } elseif ($university == "itb" || $university == "institut teknologi bandung") {
- $lokasi = "Bandung";
- } elseif ($university == "undip" || $university == "universitas diponogoro") {
- $lokasi = "Semarang";
- } elseif ($university == "ugm" || $university == "universitas gajah mada") {
- $lokasi = "Yogyakarta";
- } elseif ($university == "unpas" || $university == "universitas pasundan") {
- $lokasi = "Bandung";
- } else {
- $lokasi = "tidak diketahui";
- }
- //farisrasyid
- if ($lokasi == "Tidak diketahui") {
- echo "<p>Lokasi dari $university $lokasi</p>";
- } else {
- echo "<p>$university berada di $lokasi</p>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement