Salam All Guys... I have stuck in multiple function in php single page
for example i have created a login() and home() when i do my login it shows home but login still there how can i only view one function at a time..
here is the script
<?php
function login() {
if (isset($_POST['sub'])) {
$user = $_POST['user'];
$gender = isset($_POST['check']);
if ($user == "admin" && $gender == "male") {
echo "oh boy you have access to this site";
home();
} else if ($user == "admin" && $gender == "female") {
echo " Hey Lady.. You have access to this site";
home();
} else if ($gender == "" || $gender != "male" || $gender != "female") {
echo "please select gender";
} else if ($user == "" || $user == " ") {
echo "input username";
} else {
echo " '" . $user . "' " . " you enter is wrong";
}
}
}
?>
<?php
login();
?>
<form method="POST" >
<input type="text" name="user" placeholder="username" /><br>
Male: <input type="radio" value="male" name="check"> female : <input type="radio"
value="female" name="check" > <br> <input type="submit" name="sub">
</form>
<?php
function home() {
?>
<p><center>Practice of string a simple test home() </center></p>
<?php
$a = "multi thinker ";
$w = ucwords($a);
$trim = trim($a, " ");
$trim = ltrim($a, " ");
$trim = rtrim($a, " ");
echo $w . " " . $trim;
}
?>