Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.68 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8" />
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <title>Page Title 3</title>
  7.     <meta name="viewport" content="width=device-width, initial-scale=1">
  8.     <link rel="stylesheet" type="text/css" media="all" href="main.css" />
  9. </head>
  10. <body>
  11. <form autocomplete="off" action="task3.php" method="post">
  12.     Введіть ім'я -    <input required type="text"  name="name" value="<?php  $a=isset($_POST['name']); ?>"><br>
  13.     Введіть прізвище - <input required type="text"  name="surname" value="<?php  $b=isset($_POST['surname']); ?>"><br>
  14.     Введіть вік - <input required type="number"  name="age" value="<?php  $c=isset( $_POST['age']); ?>"><br>
  15.     Введіть email - <input required type="text"  name="email" value="<?php   $d=isset($_POST['email']); ?>"><br>
  16.     <button type="submit">Створити</button><br>
  17. </form>
  18. <?php
  19. error_reporting(0);
  20. class User {
  21.  
  22.     private $name = "";
  23.     private $surname = "";
  24.     private $age = "";
  25.     private $email = "";
  26.     function __construct($name,$surname, $age, $email){
  27.         $this -> name = $name;
  28.         $this -> age = $age;
  29.         $this -> email = $email;
  30.         $this -> surname =$surname;
  31.     }
  32.     public function renderInfoAboutUser() {
  33.         echo "Користувач:";echo $this->name;echo " ";echo $this->surname; echo "<div></div>";
  34.         echo "Вік: ";echo $this->age;
  35.         echo "<div></div>";
  36.         echo "Email:";echo $this->email; echo "</div>";
  37.  
  38.     }
  39.  
  40. }
  41. $user = new User($a,$b, $c, $d);
  42. $user->renderInfoAboutUser();
  43. ?>
  44. <br><a href="main.html">На ГОЛОВНУ!</a>
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement