Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getData()
- {
- if ($_SERVER['REQUEST_METHOD'] === 'GET') { //Sprawdzenie czy wysyłamy dane getem
- if (isset($_GET['width']) && isset($_GET['height'])) { //Sprawdzamy czy wysyłamy wszystkie dane
- $width = $_GET['width']; //Przypisujemy szerokość z GET'a
- $height = $_GET['height']; //Przypisujemy wysokość z GET'a
- } else {
- $width = 5; //Jeżeli nie ma dancych w gecie to ustawiamy na 5
- $height = 5;
- }
- }
- }
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Zadanie 4</title>
- </head>
- <body>
- <?php
- getData();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment