-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop-simple.php
More file actions
48 lines (38 loc) · 946 Bytes
/
oop-simple.php
File metadata and controls
48 lines (38 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<body>
<?php
class User
{
public $public = "Public";
protected $protected = "Protected";
protected $username;
protected $email;
public function setUsername($username)
{
$this->username = $username;
}
public function getUsername()
{
return "Username: ".$this->username;
}
}
$user = new User();
$user->setUsername("Panyi");
echo $user->getUsername()."<br/>";
echo $user->public;
if(isset($_POST["fname"])){
echo "<br/>Selamat datang ".$_POST["fname"]." ".$_POST["lname"]."<br/>";
}
?>
<form method="POST">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname" value="<?php @$_POST["fname"]; ?>"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname" value="<?php @$_POST["lname"]; ?>"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
<?php
$b = (true and false);
var_dump($b);