Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // 1. printing something
- // function pr($printThis){
- // echo $printThis;
- // }
- // pr("I am Just a String");
- // 2. returing something
- // function firstFunc( $name ) {
- // return $name;
- // }
- // echo firstFunc( "hamza" );
- // function add($x , $y, $z) {
- // return $x + $y + $z;
- // }
- // echo add( 4 , 5 , 1);
- // 3. doing something in background
- // function returnBool(){
- // return true;
- // }
- // function isUserOk ( $username , $password ) {
- // $dbUsername = "thejini3";
- // $dbPassword = "1234";
- // // if( $username == $dbUsername && $password == $dbPassword ) {
- // // return true;
- // // } else {
- // // return false;
- // // }
- // return ( $username == $dbUsername && $password == $dbPassword ) ? true : false;
- // }
- // if ( isUserOk( "thejini3" , "1234" ) ) {
- // echo "login success";
- // } else {
- // echo "login error";
- // }
- // $name = "outside func";
- // function scopeTest(){
- // global $name;
- // return $name;
- // }
- ?>
- <?php
- if(isset($_POST["submitButton"])) {
- $name = $_POST["myName"];
- // echo $name;
- if( userExist( $name ) ) {
- echo "login success";
- }
- }
- ?>
- <form action="" method="post">
- <input type="text" name="myName">
- <input type="submit" name="submitButton">
- </form>
- <!-- // Normal Syntex
- // 100% - 200% Object Oriented Programming -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement