├── .gitignore ├── hw ├── Jun-6-2022 │ └── 13_form_abuzar │ │ ├── .gitignore │ │ ├── package.json │ │ ├── .DS_Store │ │ ├── package-lock.json │ │ └── abuzar.php ├── may-16-2022 │ └── 13_form_abuzar │ │ ├── .gitignore │ │ ├── package.json │ │ ├── .DS_Store │ │ ├── package-lock.json │ │ └── abuzar.php ├── mar-23-2022 │ ├── MATH PHP TURZO │ │ ├── answer.txt │ │ └── index.php │ └── function.php ├── mar-21-2022 │ ├── TURZO PHP Assignment 3 │ │ ├── LEAP YEAR │ │ │ ├── answer.txt │ │ │ └── index.php │ │ └── NOT LEAP YEARR │ │ │ ├── answer.txt │ │ │ └── index.php │ ├── PHP Amit │ │ └── leap year.php │ └── LeapYear(abuzar).php ├── mar-30-2022 │ ├── SHOW DATA FOREACH LOOP │ │ ├── answer.txt │ │ └── data.php │ └── foreach_abuzar │ │ └── foreach.php ├── mar-16-2022 │ ├── turzo │ │ ├── prog.php │ │ ├── variables answer.txt │ │ └── index.php │ ├── Text PHP Amit │ │ └── syntex.php │ ├── Saif_assin-2 │ │ └── variable.php │ └── abuzar.php ├── apr-11-2022 │ ├── hw_abuzar │ │ ├── .DS_Store │ │ ├── one.php │ │ └── two.php │ ├── PHP-Amit │ │ ├── myheader1.php │ │ └── myheader2.php │ └── BUTTON REDIRECT │ │ └── index.php ├── Apr-6-2022 │ ├── PHP-Amit │ │ ├── syntex.php │ │ └── array.php │ └── hw-7 │ │ └── AssociativeArray.php ├── mar-14-2022 │ ├── PHP Amit │ │ ├── syntex.php │ │ └── variable.php │ ├── Saif php │ │ ├── l1-syntex.php │ │ ├── l3-php-comment.php │ │ └── l2-echo_print.php │ └── phphw-01 │ │ ├── db.php │ │ └── chat.php ├── apr-20-2022 │ ├── PHP-Amit │ │ └── date.php │ └── hw-10 │ │ └── next7dayswithLoop.php ├── apr-18-2022 │ ├── PHP IN HTML HTML IN PHP │ │ ├── index2.php │ │ └── index.php │ ├── PHP-Amit │ │ └── html undercondition.php │ └── hw_abuzar │ │ └── htmlUnderPhp.php ├── apr-25-2022 │ ├── explode & implode.php │ └── hw_abuzar.php ├── apr-27-2022 │ ├── PHP-Amit │ │ └── referance-variable.php │ └── hw_abuzar │ │ └── abuzar.php └── mar-28-2022 │ ├── Button function Turzo │ └── index.php │ └── namta_abuzar │ └── namta.php ├── package.json ├── imageUpload ├── download.png └── t8s04a628259c1c7cebpm040345May162022Mondaydownload.png ├── l34Crud ├── images │ ├── profile.png │ └── i4eW7Z62b328fd98b46pm043645June222022Wednesday1540267867863.jpg ├── db.php ├── logout.php ├── footer.php ├── deleteUser.js ├── index.php ├── header.php ├── login.php ├── changePass.php ├── addUser.php ├── updateProfile.php ├── sideBar.php ├── userlist.php └── formSubmit.php ├── l1-syntext.php ├── l29.session-p2.php ├── l13.header1.php ├── l2-echo-print.php ├── l29.session-p1.php ├── l3.how2Comment.php ├── l31.php-block.php ├── l17.exploade&impload.php ├── l18.reference-variable.php ├── l24.oopInheritenceClass.php ├── l16.const.php ├── l28.oopPrivateConstruct.php ├── l19.simple-syntax.php ├── l26.oopConstructDestructFunc.php ├── l4.veriable.php ├── l27.oopConstantAndStaticPro.php ├── l11.superGlobal.php ├── l13.header2.php ├── l23.oopClass.php ├── l5.datatype.php ├── l10.get.php ├── l9.loop.php ├── l32-mySQLQuries.txt ├── l15.date.php ├── l8.function.php ├── l6.operators.php ├── l22.fileupload.php ├── l14.htmlUnderCondition.php ├── l25.oopAccessModifire.php ├── l33-ConnectWithMySQL.php ├── l7.condition.php ├── l30.session-p3.php ├── l20.formValidation.php ├── l12.array.php └── l21.formValidation.php /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /hw/Jun-6-2022/13_form_abuzar/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /hw/may-16-2022/13_form_abuzar/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /hw/mar-23-2022/MATH PHP TURZO/answer.txt: -------------------------------------------------------------------------------- 1 | 100 2 | 1000 3 | -------------------------------------------------------------------------------- /hw/mar-21-2022/TURZO PHP Assignment 3/LEAP YEAR/answer.txt: -------------------------------------------------------------------------------- 1 | this is a leap year 2 | 3 | -------------------------------------------------------------------------------- /hw/mar-30-2022/SHOW DATA FOREACH LOOP/answer.txt: -------------------------------------------------------------------------------- 1 | cities are 4 2 | 3 | person data 5 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "bootstrap": "^5.1.3" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /hw/mar-21-2022/TURZO PHP Assignment 3/NOT LEAP YEARR/answer.txt: -------------------------------------------------------------------------------- 1 | this is not a leap year 2 | -------------------------------------------------------------------------------- /hw/mar-16-2022/turzo/prog.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /imageUpload/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b75PHP/main/imageUpload/download.png -------------------------------------------------------------------------------- /l34Crud/images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b75PHP/main/l34Crud/images/profile.png -------------------------------------------------------------------------------- /hw/Jun-6-2022/13_form_abuzar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "bootstrap": "^5.1.3" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /hw/may-16-2022/13_form_abuzar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "bootstrap": "^5.1.3" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /l34Crud/db.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l34Crud/logout.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hw/apr-11-2022/hw_abuzar/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b75PHP/main/hw/apr-11-2022/hw_abuzar/.DS_Store -------------------------------------------------------------------------------- /hw/mar-16-2022/turzo/variables answer.txt: -------------------------------------------------------------------------------- 1 | string 2 | string 3 | boolean 4 | string 5 | NULL 6 | string 7 | integer 8 | double -------------------------------------------------------------------------------- /hw/Jun-6-2022/13_form_abuzar/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b75PHP/main/hw/Jun-6-2022/13_form_abuzar/.DS_Store -------------------------------------------------------------------------------- /hw/Apr-6-2022/PHP-Amit/syntex.php: -------------------------------------------------------------------------------- 1 | "; 4 | echo "Dhaka is the capital of bangladesh
"; 5 | ?> -------------------------------------------------------------------------------- /hw/may-16-2022/13_form_abuzar/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b75PHP/main/hw/may-16-2022/13_form_abuzar/.DS_Store -------------------------------------------------------------------------------- /l1-syntext.php: -------------------------------------------------------------------------------- 1 | "; 3 | echo "ho ho ho" 4 | ?> 5 | this is a code from outside php -------------------------------------------------------------------------------- /l29.session-p2.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hw/mar-14-2022/PHP Amit/syntex.php: -------------------------------------------------------------------------------- 1 | "; 4 | echo "Dhaka is the capital of Bangladesh." 5 | 6 | ?> 7 | 8 | -------------------------------------------------------------------------------- /hw/mar-16-2022/Text PHP Amit/syntex.php: -------------------------------------------------------------------------------- 1 | "; 4 | echo "Dhaka is the capital of Bangladesh." 5 | 6 | ?> 7 | 8 | -------------------------------------------------------------------------------- /hw/mar-14-2022/Saif php/l1-syntex.php: -------------------------------------------------------------------------------- 1 | "; 3 | echo "Hello Bangladesh
" 4 | ?> 5 | This is code from outside php -------------------------------------------------------------------------------- /imageUpload/t8s04a628259c1c7cebpm040345May162022Mondaydownload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b75PHP/main/imageUpload/t8s04a628259c1c7cebpm040345May162022Mondaydownload.png -------------------------------------------------------------------------------- /hw/mar-14-2022/Saif php/l3-php-comment.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l34Crud/images/i4eW7Z62b328fd98b46pm043645June222022Wednesday1540267867863.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b75PHP/main/l34Crud/images/i4eW7Z62b328fd98b46pm043645June222022Wednesday1540267867863.jpg -------------------------------------------------------------------------------- /hw/apr-11-2022/PHP-Amit/myheader1.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 |
-------------------------------------------------------------------------------- /l13.header1.php: -------------------------------------------------------------------------------- 1 | 6 |
7 | 8 |
-------------------------------------------------------------------------------- /hw/mar-23-2022/function.php: -------------------------------------------------------------------------------- 1 | 2 | The given number is simply being doubled: ". $n * 2 .""; 7 | } 8 | echo power($n); 9 | echo "Wow! it works."; 10 | 11 | ?> -------------------------------------------------------------------------------- /hw/mar-21-2022/PHP Amit/leap year.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l2-echo-print.php: -------------------------------------------------------------------------------- 1 | ","sheo vaat khay
"; 3 | // print "tumi vaat khao","vaat khele mota hoy"; 4 | print "tumi vaat khao"; 5 | print("ha ha ha
"); 6 | echo("this is a text from echo"); 7 | ?> -------------------------------------------------------------------------------- /l29.session-p1.php: -------------------------------------------------------------------------------- 1 | "; 9 | echo $email; 10 | ?> -------------------------------------------------------------------------------- /l3.how2Comment.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hw/mar-14-2022/PHP Amit/variable.php: -------------------------------------------------------------------------------- 1 | "; 4 | echo "integer
"; 5 | echo "double
"; 6 | echo "string
"; 7 | echo "string
"; 8 | echo "boolean
"; 9 | echo "string
"; 10 | echo "null
"; 11 | ?> -------------------------------------------------------------------------------- /hw/mar-23-2022/MATH PHP TURZO/index.php: -------------------------------------------------------------------------------- 1 | 16 | 17 | -------------------------------------------------------------------------------- /hw/apr-20-2022/PHP-Amit/date.php: -------------------------------------------------------------------------------- 1 | "; 6 | $startDate = strtotime("+1 days", $startDate); 7 | } 8 | ?> -------------------------------------------------------------------------------- /hw/mar-14-2022/phphw-01/db.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l34Crud/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /l31.php-block.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 |

condition puron hoise

10 | 11 | 14 | 15 |

Condition puron hoyni

16 | 17 | -------------------------------------------------------------------------------- /hw/apr-20-2022/hw-10/next7dayswithLoop.php: -------------------------------------------------------------------------------- 1 | "; 8 | $begin_date = strtotime ("+1 day", $begin_date); 9 | } 10 | 11 | ?> -------------------------------------------------------------------------------- /hw/apr-11-2022/hw_abuzar/one.php: -------------------------------------------------------------------------------- 1 | 6 |

হোমওয়ার্ক নিউজ পোর্টাল

7 |
8 |

সর্বশেষ আন্তর্জাতিক খবর - অর্থনীতি

9 | 10 |
11 | 12 |
-------------------------------------------------------------------------------- /l34Crud/deleteUser.js: -------------------------------------------------------------------------------- 1 | const myModal = document.getElementById("myModal"); 2 | const delUserId = document.getElementById("delUserId"); 3 | myModal.addEventListener("show.bs.modal", (e) => { 4 | const button = e.relatedTarget; 5 | const recipient = button.getAttribute("data-bs-id"); 6 | delUserId.value = recipient; 7 | }); 8 | -------------------------------------------------------------------------------- /hw/apr-18-2022/PHP IN HTML HTML IN PHP/index2.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Turzo small test 5 | 6 | "; 9 | echo "My house is " . $color . "
"; 10 | echo "My boat is " . $color . "
"; 11 | ?> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /hw/apr-11-2022/BUTTON REDIRECT/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | URL REDIRECT DTURZO 6 | 7 | 8 | 9 |
10 | 11 |
12 | 13 | -------------------------------------------------------------------------------- /hw/apr-25-2022/explode & implode.php: -------------------------------------------------------------------------------- 1 | ", $city)."
"; 4 | $dbData = implode(",", $city); 5 | $dbArray = explode(",", $dbData); 6 | var_dump($dbArray); 7 | echo "
"; 8 | foreach ($dbArray as $myArray) { 9 | echo $myArray."
"; 10 | } 11 | ?> -------------------------------------------------------------------------------- /hw/apr-27-2022/PHP-Amit/referance-variable.php: -------------------------------------------------------------------------------- 1 | "; 5 | $Alom = "Pori"; 6 | $Pori = "Alom"; 7 | $Tahsan = "Mithila"; 8 | $Murad = "Mahi"; 9 | $popi = "Mahfuz"; 10 | $$$$$$Alom = "Ananta"; 11 | $Ananta = "Takla"; 12 | $Takla = "haha"; 13 | echo $$$$Alom." ".$Pori; 14 | ?> -------------------------------------------------------------------------------- /hw/mar-30-2022/SHOW DATA FOREACH LOOP/data.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | "Asif Abir", "age"=>35, "city"=>"Dhaka", "profession"=>"Teacher", "gender"=>"Male" ]; 11 | 12 | echo count($personData); 13 | 14 | ?> 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /l34Crud/index.php: -------------------------------------------------------------------------------- 1 | 7 |
8 |
9 | 10 |
11 |
12 |
13 | 14 | 17 | -------------------------------------------------------------------------------- /l17.exploade&impload.php: -------------------------------------------------------------------------------- 1 | ", $city)."
"; 5 | // var_dump($city); 6 | $dbData = implode(",", $city); 7 | $dbArray = explode(",", $dbData); 8 | var_dump($dbArray); 9 | // echo $dbArray; 10 | echo "
"; 11 | foreach($dbArray as $myArray){ 12 | echo $myArray."
"; 13 | } 14 | ?> -------------------------------------------------------------------------------- /l18.reference-variable.php: -------------------------------------------------------------------------------- 1 | "; 5 | echo "${$person_name} is the father of $person_name
"; 6 | 7 | $Jolil = "Mahfuz"; 8 | $Mahfuz = "Alom"; 9 | $Alom = "Murad"; 10 | $Murad = "Pori"; 11 | $Pori = "Mithila"; 12 | $$$$$$Jolil = "fahim"; 13 | 14 | echo $$$$$$Jolil." ".$Mithila; 15 | ?> -------------------------------------------------------------------------------- /l24.oopInheritenceClass.php: -------------------------------------------------------------------------------- 1 | dadarJomi." ".$myObj->babarBari; 17 | ?> -------------------------------------------------------------------------------- /hw/mar-21-2022/TURZO PHP Assignment 3/NOT LEAP YEARR/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l16.const.php: -------------------------------------------------------------------------------- 1 | "; 6 | 7 | $x = 35; 8 | echo $x."
"; 9 | 10 | /* $y = 16; 11 | $y = 35; 12 | echo $y; */ 13 | $person_name = "Asif Abir"; 14 | echo $person_name."
"; 15 | 16 | $person_name = "Amit Gosh"; 17 | echo $person_name."
"; 18 | 19 | define("person_name1", "Asif Abir"); 20 | echo person_name1."
"; 21 | 22 | define("person_name2", "Amit Gosh"); 23 | echo person_name2; 24 | ?> -------------------------------------------------------------------------------- /hw/mar-28-2022/Button function Turzo/index.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 |
12 | 13 | 14 | 15 |
-------------------------------------------------------------------------------- /l28.oopPrivateConstruct.php: -------------------------------------------------------------------------------- 1 | "; 13 | // echo $myObj->myPro; 14 | // echo "
"; 15 | 16 | // $hackerObj = new myClass; 17 | // $hackerObj->myPro = "Your wehsite is hacked!"; 18 | // echo $hackerObj->myPro; 19 | echo myClass::$myPro; 20 | ?> -------------------------------------------------------------------------------- /hw/Apr-6-2022/PHP-Amit/array.php: -------------------------------------------------------------------------------- 1 | ["Bangladesh", "India", "Pakistan", "USA", "England", "Canada", "Rasia"], 5 | "capitals" => ["Dhaka", "New Dillih", "Islamabad", "Washington DC", "London", "Ottawa","Mosko"], 6 | "continents" => ["Asia", "Asia", "Asia", "America", "Europe", "America", "Asia"] 7 | ]; 8 | 9 | foreach ($countries as $desh => $country){ 10 | foreach ($country as $data){ 11 | echo $desh." : ".$data." "; 12 | } 13 | echo "
"; 14 | } 15 | 16 | ?> -------------------------------------------------------------------------------- /hw/apr-11-2022/PHP-Amit/myheader2.php: -------------------------------------------------------------------------------- 1 | 6 | Pahela Baishakh or the first day of Bengali New Year (Bengali: 'Bangla Noboborsho'), is the traditional new year day of the Bengali people. According to the lunisolar Bengali calendar every year, 14 April, the first day of the first month, Boishakh is celebrated as a national holiday in Bangladesh. 7 |

8 |
9 | 10 |
-------------------------------------------------------------------------------- /hw/mar-16-2022/turzo/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | "; 9 | 10 | $b= "False"; 11 | echo gettype($b) . "
"; 12 | 13 | $c = false; 14 | echo gettype($c) . "
"; 15 | 16 | $d = "null"; 17 | echo gettype($d) . "
"; 18 | 19 | $e = null; 20 | echo gettype($e) . "
"; 21 | 22 | $x= "Bangladesh"; 23 | echo gettype($x) . "
"; 24 | 25 | $y = 123; 26 | echo gettype($y) . "
"; 27 | 28 | $z = 0.5; 29 | echo gettype($z) . "
"; 30 | 31 | ?> 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /l19.simple-syntax.php: -------------------------------------------------------------------------------- 1 | "; 5 | 6 | $d = "day"; 7 | $ws = ['Sun', 'Mon', 'Tues', 'Wednes', 'Thurs', 'Fri', 'Satter']; 8 | foreach($ws as $w){ 9 | ${$w} = "$w${d}
"; 10 | $week[] = ${$w}; 11 | } 12 | echo "
";
13 |     print_r($week);
14 |     echo "
"; 15 | echo "
";
16 |     print_r(array_map("myFunc", $week));
17 |     echo "
"; 18 | function myFunc ($data) { 19 | return strtoupper($data); 20 | } 21 | ?> -------------------------------------------------------------------------------- /l26.oopConstructDestructFunc.php: -------------------------------------------------------------------------------- 1 | "; 11 | } 12 | public function __construct() 13 | { 14 | echo "Ha ha ha ".$this->myProperty."
"; 15 | } 16 | } 17 | $myObj = new myClass; 18 | echo $myObj->amit() 19 | ?> -------------------------------------------------------------------------------- /l4.veriable.php: -------------------------------------------------------------------------------- 1 | This is text from inside a variable"; 4 | echo $ourFirstVar; 5 | // echo "
"; 6 | echo $ourFirstVar; 7 | 8 | /* rules: 9 | 1. use a dolar sign 10 | 2. give a name 11 | 3. use the equal sign 12 | 4. asign a value 13 | 5. call the variable */ 14 | 15 | /* correct way to declare a variable name 16 | $X 17 | $xyz 18 | $ABC 19 | $abc 20 | $abc_123 21 | $_abc_123 22 | $aBc123 23 | 24 | wrong way 25 | $123 26 | $123abc */ 27 | ?> -------------------------------------------------------------------------------- /l27.oopConstantAndStaticPro.php: -------------------------------------------------------------------------------- 1 | "; 7 | public string $myPro; 8 | public static string $ending = "..."; 9 | public function __construct() 10 | { 11 | myClass::$ending = "---"; 12 | $this->myPro = myClass::myCon.myClass::$ending; 13 | echo "Amar Bangladesh
"; 14 | } 15 | } 16 | $myObj = new myClass; 17 | echo $myObj::myCon; 18 | echo $myObj->myPro; 19 | echo $myObj::$ending; 20 | ?> -------------------------------------------------------------------------------- /l11.superGlobal.php: -------------------------------------------------------------------------------- 1 | "; 12 | echo $_SERVER['SERVER_NAME']; 13 | echo "
"; 14 | echo $_SERVER['HTTP_HOST']; 15 | echo "
"; 16 | echo $_SERVER['HTTP_USER_AGENT']; 17 | echo "
"; 18 | echo $_SERVER['REQUEST_METHOD']; 19 | echo "
"; 20 | echo $_SERVER['SCRIPT_NAME']; 21 | echo "
"; 22 | echo $_SERVER['REMOTE_ADDR']; 23 | echo "
"; 24 | 25 | echo myFunc(); 26 | ?> -------------------------------------------------------------------------------- /l13.header2.php: -------------------------------------------------------------------------------- 1 | 6 | Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quos dolorum error porro neque minima culpa sed facere assumenda laborum officiis. Cupiditate, neque dicta iste quas vitae blanditiis beatae repudiandae qui ratione exercitationem delectus natus culpa aut. Consequatur, itaque! Ipsum ullam necessitatibus molestias numquam nemo, architecto laboriosam non, expedita unde culpa, eos placeat pariatur vero? Numquam quibusdam aliquid nisi omnis deleniti. 7 |

8 |
9 | 10 |
-------------------------------------------------------------------------------- /l23.oopClass.php: -------------------------------------------------------------------------------- 1 | email = $uEmail; 9 | return $this->email; 10 | } 11 | 12 | public function amitAge ($age) 13 | { 14 | if($age > 18){ 15 | return "You are a young man"; 16 | } 17 | return "You are not allowed to our website"; 18 | } 19 | } 20 | $obj = new amit; 21 | echo $obj->name."
"; 22 | echo $obj->amitEmail("amit74@dipti.com.bd")."
"; 23 | echo $obj->amitAge(24)."
"; 24 | 25 | echo phpversion(); 26 | ?> -------------------------------------------------------------------------------- /l34Crud/header.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Document 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /l5.datatype.php: -------------------------------------------------------------------------------- 1 | "; 6 | 7 | //integer 8 | $x = 123; 9 | var_dump($x); 10 | echo "
"; 11 | 12 | //float 13 | $x = 123.56; 14 | var_dump($x); 15 | echo "
"; 16 | 17 | //boolean 18 | $x = false; 19 | var_dump($x); 20 | echo "
"; 21 | 22 | //array 23 | $x = ["Dhaka", "CTG", "Khulna"]; 24 | var_dump($x); 25 | echo "
"; 26 | 27 | //null 28 | $x = null; 29 | var_dump($x); 30 | echo "
"; 31 | 32 | //object 33 | class objClass { 34 | public $objPro = "This is a text"; 35 | } 36 | $x = new objClass; 37 | var_dump($x); 38 | echo "
"; 39 | 40 | //resource 41 | ?> -------------------------------------------------------------------------------- /hw/mar-21-2022/TURZO PHP Assignment 3/LEAP YEAR/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hw/apr-27-2022/hw_abuzar/abuzar.php: -------------------------------------------------------------------------------- 1 | "; 13 | echo $family." is the bachbone of a"." ".$a ."
"; 14 | echo $mainCharacter." is the true queen of every"." ".$mother."
"; 15 | echo $home." "."are everything for"." ".$family." "."and"." ".$mainCharacter; 16 | 17 | echo '
'; 18 | echo '
'; 19 | 20 | echo "Something about a"." ".$a.":"."
"; 21 | echo $$a." is the bachbone of a"." ".$a ."
"; 22 | echo $$$$a." is the true queen of every"." ".$$$$$a."
"; 23 | echo $$$$$$a." "."are everything for"." ".$$a." "."and"." ".$$$$a; 24 | 25 | 26 | 27 | ?> -------------------------------------------------------------------------------- /hw/mar-14-2022/Saif php/l2-echo_print.php: -------------------------------------------------------------------------------- 1 | ", "Allah Loves Us
"; 3 | // print "Muhammad is our prophet", "He teach us salat"; 4 | print "Muhammad is our prophet
"; 5 | print "Muhammad is our prophet
He teach us"; 6 | ?> 7 | 8 | 9 | 10 | 11 | 12 | 13 | PHP First Class 14 | 15 | 16 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fugit, perferendis facere atque necessitatibus inventore consequuntur laboriosam? Distinctio ea error vel voluptas, ducimus tempora ut? Eius dolores reiciendis laboriosam rerum aut? 17 | 18 | -------------------------------------------------------------------------------- /l10.get.php: -------------------------------------------------------------------------------- 1 | "; 5 | $currentFileName = basename($_SERVER['PHP_SELF']); 6 | ?> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | "; 26 | } 27 | } 28 | ?> -------------------------------------------------------------------------------- /hw/Apr-6-2022/hw-7/AssociativeArray.php: -------------------------------------------------------------------------------- 1 | ["Bangladesh", "India", "Pakistan", "USA", "England", "Canada", "Russia"], 5 | 'capitals' => ["Dhaka", "New Delhi", "Islamabad", "Washington DC", "London", "Ottawa","Mosko"], 6 | 'continents' => ["Asia", "Asia", "Asia", "America", "Europe", "America", "Asia"] 7 | 8 | ]; 9 | 10 | 11 | foreach( $countries as $countryIndex => $countryInfo){ 12 | foreach ($countryInfo as $country_data){ 13 | echo ucfirst(substr($countryIndex, 0, -1)). " : ".$country_data."
"; 14 | } 15 | 16 | echo "
"; 17 | } 18 | 19 | $p = 0; 20 | 21 | for($i = $p; $i < count($countryInfo); $i++) { 22 | foreach ($countries as $countryIndex => $countryInfo){ 23 | for ($j = $p; $j < $p+1; $j++ ){ 24 | echo ucfirst(substr($countryIndex, 0, -1))." : ".$countryInfo[$j]." "; 25 | } 26 | echo "
"; 27 | } 28 | $p++; 29 | 30 | } 31 | 32 | 33 | ?> -------------------------------------------------------------------------------- /l9.loop.php: -------------------------------------------------------------------------------- 1 | "; 11 | $ghor = 5293; 12 | $increment = 1; 13 | // 2 x 1 = 2 14 | while ($increment <= 10) { 15 | echo $ghor." x ".$increment." = ".$ghor*$increment."
"; 16 | $increment++; 17 | } 18 | 19 | echo "
"; 20 | 21 | $y = 9; 22 | while ($y >= 0) { 23 | echo $y."
"; 24 | $y--; 25 | } 26 | 27 | echo "
"; 28 | //for loop 29 | for ($i = 0; $i < 10; $i++) { 30 | echo $i.", "; 31 | } 32 | echo "
"; 33 | $ghor = 100; 34 | for ($increment = 1; $increment <= 10; $increment++) { 35 | echo $ghor." x ".$increment." = ".$ghor*$increment."
"; 36 | } 37 | echo "
"; 38 | //do while 39 | $a = 20; 40 | do { 41 | echo $a; 42 | $a++; 43 | }while ($a < 10); 44 | 45 | //foreach 46 | ?> -------------------------------------------------------------------------------- /hw/mar-21-2022/LeapYear(abuzar).php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Leap Year 8 | 9 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 45 | 46 |
47 | -------------------------------------------------------------------------------- /l32-mySQLQuries.txt: -------------------------------------------------------------------------------- 1 | SELECT * FROM `students` 2 | SELECT * FROM `students` WHERE `id` = 1 3 | SELECT * FROM `students` WHERE `name` = "Amit Ghosh" 4 | SELECT * FROM `students` WHERE `name` = "Amit Ghosh" AND `city` = "Dhaka" 5 | INSERT INTO `students` (`name`, `city`, `gender`, `father`, `mother`) VALUES ("Sadik Saad", "Bogura", "Male", "Father of Sadik", "Mother of Sadik") 6 | INSERT INTO `students` (`name`, `city`, `gender`, `father`, `mother`) VALUES ("Kamal Mia", "Bogura", "Male", "Father of Kamal", "Mother of Kamal"), ("Jamal Mia", "Bogura", "Male", "Father of Jamal", "Mother of Jamal"), ("Tomal Mia", "Bogura", "Male", "Father of Tomal", "Mother of Tomal") 7 | UPDATE `students` SET `name` = "Amitav Bacchan" WHERE id = 3 8 | UPDATE `students` SET `name` = "Kamal Khan", `city` = "Kustia" WHERE id = 5 9 | DELETE FROM `students` WHERE `id` = 7 10 | SELECT `students`.`name`, `results`.`grade` FROM `students` INNER JOIN `results` ON `students`.`id` = `results`.`student_id` WHERE `students`.`id` = 1 11 | SELECT * FROM `students` LIMIT 3, 5 12 | SELECT * FROM `students` WHERE `name` LIKE "%Amit%" -------------------------------------------------------------------------------- /l15.date.php: -------------------------------------------------------------------------------- 1 | "; 3 | date_default_timezone_set("Asia/Dhaka"); 4 | echo date("m/d/y h:i:s a")."
"; 5 | echo date("M/d/Y H:i:s")."
"; 6 | echo date("F/d/Y")."
"; 7 | echo date("F/d/Y D")."
"; 8 | echo date("F/d/Y l h:i:s A")."
"; 9 | 10 | // mktime 11 | // hour minute second month day year 12 | $myTime = mktime(23, 24, 25, 9, 10, 2005); 13 | echo date("F/d/Y l h:i:s A", $myTime)."
"; 14 | 15 | //strtotime 16 | echo date("F/d/Y l h:i:s A", strtotime("Next Day"))."
"; 17 | echo date("F/d/Y l h:i:s A", strtotime("+15 days"))."
"; 18 | echo date("F/d/Y l h:i:s A", strtotime("+7 months"))."
"; 19 | echo date("F/d/Y l h:i:s A", strtotime("+3 years +2 months +3 weeks +5 days"))."
"; 20 | 21 | // next 7 fridays 22 | $startDate = strtotime("next friday"); 23 | $endDate = strtotime("+6 week", $startDate); 24 | while ($startDate <= $endDate) { 25 | echo date("F-d-Y l", $startDate)."
"; 26 | $startDate = strtotime("+1 week", $startDate); 27 | } 28 | ?> -------------------------------------------------------------------------------- /hw/apr-18-2022/PHP IN HTML HTML IN PHP/index.php: -------------------------------------------------------------------------------- 1 | A 2 | 3 | 4 | THIS IS A TEST FROM TURZO 5 | 6 | 7 | 8 | welcome to experiment "; 10 | ?> 11 | 12 |

This is not a drill.

13 |

14 | 17 |

18 |

Today's Question? 19 | 20 | Why the army interferes in politics, what is the reason for their influence? 21 | 22 | It is said that the Prime Minister of Pakistan is the second most powerful leader. And the country's most powerful leader is actually the army chief.It is also said that Pakistan's foreign and defense policy is right at the army headquarters, where the civilian prime minister has no authority.Whenever a civilian government is in power in Pakistan, whatever the political party, they have to come to a compromise with the Pakistani army.But why is the military so influential in the country's politics - explains the BBC's Munni Akhter. 23 | 24 |

25 | 26 |

27 | 28 | 35 |

36 | 37 | 38 | -------------------------------------------------------------------------------- /l8.function.php: -------------------------------------------------------------------------------- 1 | "; 4 | } 5 | 6 | sadik(); 7 | 8 | // return 9 | function sadd () { 10 | return "Saad is a good boy!
"; 11 | } 12 | echo sadd(); 13 | echo sadd(); 14 | 15 | // parameters arguments 16 | function ochena ($name) { 17 | return "$name is a good boy
"; 18 | } 19 | echo ochena ("Kamal"); 20 | echo ochena ("Jamal"); 21 | 22 | // multiple parameters 23 | function rajdhani ($city, $country) { 24 | return "$city is the capital of $country
"; 25 | } 26 | echo rajdhani ("Dhaka", "Bangladesh"); 27 | echo rajdhani ("Islamabad", "Pakistan"); 28 | echo rajdhani ("New Dillih", "India"); 29 | 30 | // pass variables's data 31 | $n1 = 15; 32 | $n2 = 16; 33 | $n3 = 17; 34 | function kuddus ($a, $b, $c) { 35 | return $a + $b + $c; 36 | } 37 | echo kuddus($n1, $n2, $n3)."
"; 38 | 39 | //default value 40 | function jajabor ($himu = "Ami", $boishihto = "jajabor") { 41 | return "$himu ek $boishihto
"; 42 | } 43 | 44 | echo jajabor(); 45 | echo jajabor("Tumi"); 46 | echo jajabor("Shey", "fokir"); 47 | ?> -------------------------------------------------------------------------------- /hw/mar-14-2022/phphw-01/chat.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Chating App 8 | 9 | 10 | 11 | 12 |
13 |

Chat Application

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 | -------------------------------------------------------------------------------- /hw/mar-16-2022/Saif_assin-2/variable.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Document 19 | 30 | 31 | 32 |
33 |

PHP Datatype Check

34 | "; 36 | echo gettype($y). "
"; 37 | echo gettype($z). "
"; 38 | echo gettype($a). "
"; 39 | echo gettype($b). "
"; 40 | echo gettype($c). "
"; 41 | echo gettype($d). "
"; 42 | echo gettype($e). "
"; 43 | ?> 44 |
45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /l6.operators.php: -------------------------------------------------------------------------------- 1 | "; 27 | /* Comparison operators 28 | * == 29 | * === 30 | * < 31 | * > 32 | * >= 33 | * <= 34 | * != 35 | * !== 36 | * <> 37 | * <=> 38 | */ 39 | 40 | /* Increment/Decrement operators 41 | * ++ 42 | * -- 43 | */ 44 | 45 | //pre-Increment/Decrement operator 46 | echo ++$x."
".--$x."
"; 47 | 48 | //post-Increment/Decrement operator 49 | echo $x++."
".++$x."
"; 50 | $x++; 51 | echo $x; 52 | 53 | /* String operators 54 | * . 55 | * .= 56 | */ 57 | 58 | $fullName = "Asif"; 59 | $fullName .= " Abir"; 60 | echo "
".$fullName; 61 | 62 | /* Logical operators 63 | * and 64 | * && 65 | * or 66 | * || 67 | * xor 68 | */ 69 | 70 | ?> -------------------------------------------------------------------------------- /l22.fileupload.php: -------------------------------------------------------------------------------- 1 | 27 |
28 | 29 | 30 |
31 |
32 | "; 36 | } 37 | } 38 | ?> 39 |
40 | -------------------------------------------------------------------------------- /l14.htmlUnderCondition.php: -------------------------------------------------------------------------------- 1 | 6 |

Welcome to our Website because you are years old

7 |

8 | Lorem ipsum dolor sit amet consectetur, adipisicing elit. Asperiores pariatur saepe quisquam qui natus vitae modi accusantium enim dolor eum est, et necessitatibus impedit ipsam ipsa deserunt beatae iste distinctio temporibus! Minima voluptates perferendis excepturi labore! Omnis harum delectus vero, sint facilis porro, maxime eaque exercitationem consequuntur temporibus atque sequi? 9 |

10 | 11 | 12 |

Sorry! you are not allowed here! because you are years old

13 |

14 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Eligendi quam alias quos officia libero recusandae error minima tempora, rem inventore possimus cupiditate laudantium! Ex placeat officia nostrum accusamus error, iusto ratione repellendus libero dolore dolorum incidunt repellat itaque dignissimos enim! 15 |

16 | 17 | 18 |

19 | "> 20 | 21 | 22 | "> 23 | 24 | 25 | "> 26 | 27 | -------------------------------------------------------------------------------- /l25.oopAccessModifire.php: -------------------------------------------------------------------------------- 1 | "; 10 | } 11 | public function dadaBariFunc() 12 | { 13 | return $this->dadarJomi." dadar jomi ase!
"; 14 | } 15 | public function dadarBoyos() :int 16 | { 17 | return $this->age; 18 | } 19 | public function dadarObostha () :string 20 | { 21 | if($this->jibito){ 22 | return "amar dada ekhono beche achen
"; 23 | } 24 | return "amar dada ar beche nei!
"; 25 | } 26 | } 27 | $objDada = new dada; 28 | echo $objDada->botGach(); 29 | echo $objDada->dadaBariFunc(); 30 | // echo $objDada->age; 31 | // echo $objDada->jibito; 32 | echo $objDada->dadarBoyos()."
"; 33 | echo $objDada->dadarObostha(); 34 | 35 | class baba extends dada { 36 | public string $babarBari = "5 Tala"; 37 | } 38 | class chacha extends dada { 39 | public string $chacharBari = "10 Tala"; 40 | } 41 | 42 | class ami extends baba { 43 | public function amarShompoti () :string 44 | { 45 | return "Amar ".$this->dadarJomi." dadar jomi ase! ebong amar dadar boyosh chilo ".$this->age; 46 | } 47 | } 48 | $amarObj = new ami; 49 | echo $amarObj->amarShompoti(); 50 | ?> -------------------------------------------------------------------------------- /hw/apr-18-2022/PHP-Amit/html undercondition.php: -------------------------------------------------------------------------------- 1 | 6 |

Welcome to our website because you are years old

7 |

8 | Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quod consequuntur ea nobis odit officiis error soluta, iure similique ducimus labore dolores eius molestias perspiciatis rem mollitia voluptate magnam facilis aperiam asperiores! Enim eligendi quaerat illum recusandae, eaque fugiat iste repellendus, quisquam et molestias provident, maiores voluptatem. Esse iste itaque debitis. 9 |

10 | 11 | 12 |

Sorry! you are not allowed here! because you are years old

13 |

14 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas nemo provident cum iure debitis, animi unde nisi sunt consequatur, praesentium possimus vel similique maxime iusto, aspernatur consequuntur alias dolore laboriosam at molestias sint. Corporis ea, a autem inventore quia consequatur excepturi eius tempora libero? Aperiam quae veritatis sit nihil doloribus! 15 |

16 | 17 | 18 |

19 | "> 20 | 21 | 22 | "> 23 | 24 | 25 | "> 26 | 27 | -------------------------------------------------------------------------------- /l34Crud/login.php: -------------------------------------------------------------------------------- 1 | 8 |
9 |
10 |
11 |

Login Form

12 | 15 |
16 | 19 |
20 | 21 |
22 | 23 |
24 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 | 36 |
37 |
38 |
39 |
40 |
41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /hw/mar-28-2022/namta_abuzar/namta.php: -------------------------------------------------------------------------------- 1 | "; 4 | echo "Let's learn $subj using $method"; 5 | $HomeName = basename($_SERVER['PHP_SELF']); 6 | 7 | ?> 8 |
9 | 10 | 11 | 12 |

13 | 14 | 15 | 16 |
17 | "; 22 | } 23 | } 24 | ?> 25 |
26 | 27 | 28 | 29 |
30 | "; 35 | } 36 | } 37 | ?> 38 |
39 | 40 | 41 | 42 |
43 | "; 48 | } 49 | } 50 | ?> 51 | 52 |
53 | 54 | 55 | 56 |
57 | "; 62 | } 63 | } 64 | ?> -------------------------------------------------------------------------------- /hw/apr-25-2022/hw_abuzar.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |

Convert string to array using php function

11 | 12 | 13 | 14 |
"; 16 | 17 | $subjects = ['AI', 'Deep Learning', 'Data Science', 'Machine Learning']; 18 | echo implode(', ', $subjects); 19 | echo "
"; 20 | echo "
"; 21 | $convert = implode(',', $subjects); 22 | $convert_to_Array = explode(',', $convert); 23 | var_dump($convert_to_Array); 24 | 25 | echo "
"; 26 | echo "
"; 27 | foreach ($convert_to_Array as $myArray){ 28 | echo $myArray."
"; 29 | } 30 | 31 | echo "
"; 32 | echo "
"; 33 | 34 | echo 'Method 02: using function: str_split'."
"; 35 | $str = 'Metaverse'; 36 | $arr = str_split($str); 37 | print_r($arr); 38 | 39 | echo "
"; 40 | echo "
"; 41 | 42 | echo 'Method 03: using function: preg_split'."
"; 43 | # \s White space 44 | # ,\s Comma followed by white space 45 | # (\s|,\s) split if white space or comma followed by white space 46 | $str1 = 'Fifa World Cup, 2022'; 47 | $arr1 = preg_split('/(\s|,\s)/', $str1); 48 | echo var_dump($arr1); 49 | 50 | echo "
"; 51 | echo "
"; 52 | 53 | echo 'Method 04: using function: str_word_count'."
"; 54 | $str2 = 'Different ways to convert from string to array'; 55 | # mode 0 : number of valid words 56 | # mode 1 : returns array of valid words 57 | # mode 2 : returns array of valid words + alongwith the STARTING POSITON 58 | $arr2 = str_word_count($str2, 2); 59 | print_r($arr2)."
"; 60 | 61 | 62 | 63 | ?> -------------------------------------------------------------------------------- /hw/Jun-6-2022/13_form_abuzar/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "14", 3 | "lockfileVersion": 2, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "dependencies": { 8 | "bootstrap": "^5.1.3" 9 | } 10 | }, 11 | "node_modules/@popperjs/core": { 12 | "version": "2.11.5", 13 | "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", 14 | "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", 15 | "peer": true, 16 | "funding": { 17 | "type": "opencollective", 18 | "url": "https://opencollective.com/popperjs" 19 | } 20 | }, 21 | "node_modules/bootstrap": { 22 | "version": "5.1.3", 23 | "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", 24 | "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", 25 | "funding": { 26 | "type": "opencollective", 27 | "url": "https://opencollective.com/bootstrap" 28 | }, 29 | "peerDependencies": { 30 | "@popperjs/core": "^2.10.2" 31 | } 32 | } 33 | }, 34 | "dependencies": { 35 | "@popperjs/core": { 36 | "version": "2.11.5", 37 | "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", 38 | "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", 39 | "peer": true 40 | }, 41 | "bootstrap": { 42 | "version": "5.1.3", 43 | "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", 44 | "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", 45 | "requires": {} 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /hw/may-16-2022/13_form_abuzar/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "14", 3 | "lockfileVersion": 2, 4 | "requires": true, 5 | "packages": { 6 | "": { 7 | "dependencies": { 8 | "bootstrap": "^5.1.3" 9 | } 10 | }, 11 | "node_modules/@popperjs/core": { 12 | "version": "2.11.5", 13 | "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", 14 | "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", 15 | "peer": true, 16 | "funding": { 17 | "type": "opencollective", 18 | "url": "https://opencollective.com/popperjs" 19 | } 20 | }, 21 | "node_modules/bootstrap": { 22 | "version": "5.1.3", 23 | "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", 24 | "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", 25 | "funding": { 26 | "type": "opencollective", 27 | "url": "https://opencollective.com/bootstrap" 28 | }, 29 | "peerDependencies": { 30 | "@popperjs/core": "^2.10.2" 31 | } 32 | } 33 | }, 34 | "dependencies": { 35 | "@popperjs/core": { 36 | "version": "2.11.5", 37 | "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", 38 | "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", 39 | "peer": true 40 | }, 41 | "bootstrap": { 42 | "version": "5.1.3", 43 | "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", 44 | "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", 45 | "requires": {} 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /l33-ConnectWithMySQL.php: -------------------------------------------------------------------------------- 1 | query("INSERT INTO `students`(`name`, `city`, `gender`, `father`, `mother`) VALUES ('$name', '$city', '$gender', '$father', '$mother')"); 11 | } 12 | 13 | /* if(!$conn){ 14 | echo "Something went wrong"; 15 | }else{ 16 | echo "Database connected successfully"; 17 | } */ 18 | 19 | /* echo "
";
20 |     print_r($conn);
21 |     echo "
"; */ 22 | 23 | 24 | // $convertedData = $selectData->fetch_all(); 25 | // $convertedData = $selectData->fetch_object(); 26 | /* echo "
";
27 |     print_r($convertedData);
28 |     echo "
"; */ 29 | ?> 30 |
31 |
32 |
33 |

34 |

35 |

36 |

37 |

38 | 39 |
40 |
41 | 42 |
43 | query($selectQuery); 46 | 47 | while($obj = $selectData->fetch_object()){ 48 | echo "Name :".$obj->name."
City :".$obj->city."
Gender :".$obj->gender."

"; 49 | } 50 | ?> 51 |
52 |
53 | 54 | -------------------------------------------------------------------------------- /l34Crud/changePass.php: -------------------------------------------------------------------------------- 1 | 8 |
9 |
10 | 11 |
12 |

Change Password

13 | 16 |
17 | 20 |
21 | 22 |
23 | 24 |
25 | 28 |
29 | 30 |
31 | 32 |
33 |
34 | 35 |
36 |
37 | 38 |
39 | 40 |
41 |
42 |
43 |
44 | 45 | 48 | -------------------------------------------------------------------------------- /l7.condition.php: -------------------------------------------------------------------------------- 1 | = 18) { 4 | echo "Welcome to our website"; 5 | }else { 6 | echo "Sorry! you are not allowe dto our website"; 7 | } 8 | 9 | echo "
"; 10 | 11 | $x = 16; 12 | $y = "16"; 13 | 14 | if ($x === $y) { 15 | echo "Amar Bangladesh"; 16 | }else{ 17 | echo "joy Bangla"; 18 | } 19 | 20 | echo "
"; 21 | 22 | if ($x + 4 > 19 || $x - 2 > 15 || $x === $y || $y != $x || $x ) { 23 | echo "ha ha ha"; 24 | } 25 | 26 | echo "
"; 27 | 28 | $age = 35; 29 | 30 | if($age > 0 && $age <= 12){ 31 | echo "You are a baby"; 32 | }elseif($age > 12 && $age < 20){ 33 | echo "you are a teenager"; 34 | }elseif($age >= 20 && $age < 30){ 35 | echo "you are a young person"; 36 | }elseif($age >= 30 && $age < 50){ 37 | echo "You are a middle aged person"; 38 | }elseif($age >= 50 && $age < 150){ 39 | echo "Your are an old person"; 40 | }else{ 41 | echo "You are not in this world"; 42 | } 43 | 44 | echo "
"; 45 | 46 | //switch 47 | 48 | $city = "Bogura"; 49 | switch ($city) { 50 | case 'Chottogram': 51 | echo "Chottogram is a beautiful city"; 52 | break; 53 | 54 | case 'Rajshahi': 55 | echo "Rajshahi is a beautiful city"; 56 | break; 57 | 58 | case 'Dhaka': 59 | echo "Dhaka is a beautiful city"; 60 | break; 61 | 62 | default: 63 | echo "Bangladesh is a beautiful country"; 64 | break; 65 | } 66 | echo "
"; 67 | $x = 15; 68 | echo $x < 10 ? "Dhaka":"khulna"; 69 | 70 | /* if ($x > 10) { 71 | echo "Dhaka"; 72 | }else{ 73 | echo "khulna"; 74 | } */ 75 | echo "
"; 76 | echo $z ?? "Rusia rag korse" ; 77 | ?> -------------------------------------------------------------------------------- /l34Crud/addUser.php: -------------------------------------------------------------------------------- 1 | 8 |
9 |
10 | 11 |
12 |

Add New User

13 | 16 |
17 | 20 |
21 | 22 |
23 | 24 |
25 | 28 |
29 |
30 | 37 |
38 |
39 | 46 |
47 |
48 | 55 |
56 |
57 | 58 |
59 |
60 |
61 |
62 |
63 | 64 | 67 | -------------------------------------------------------------------------------- /hw/mar-30-2022/foreach_abuzar/foreach.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Foreach 8 | 9 | 28 | 29 | 30 | 31 | 32 | 33 | "; 36 | echo "Let's introduce with the following $subj by using $method"; 37 | $HomeName = basename($_SERVER['PHP_SELF']); 38 | 39 | ?> 40 |
41 | 42 | 43 | 44 |

45 | 46 | 47 | 48 |
49 | "; 59 | echo "
"; 60 | ?> 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | "; 70 | if(isset($_GET['Personal_Data'])) { 71 | $personData = ["name"=>"Asif Abir", "age"=>35, "city"=>"Dhaka", "profession"=>"Teacher", "gender"=>"Male"]; 72 | foreach($personData as $inName => $personDetail) { 73 | echo strtoupper($inName)." : ".$personDetail."
"; 74 | } 75 | 76 | } 77 | ?> 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /hw/mar-16-2022/abuzar.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Data Type 8 | 9 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
57 | 58 | 59 |
"; 63 | 64 | $y = 123; 65 | var_dump($y); 66 | echo $y."

"; 67 | 68 | $z = 0.5; 69 | var_dump($z); 70 | echo $z."

"; 71 | 72 | $a = "234"; 73 | var_dump($a); 74 | echo $a."

"; 75 | 76 | $b = "False"; 77 | var_dump($b); 78 | echo $b."

"; 79 | 80 | $c = false; 81 | var_dump($c); 82 | echo $c."

"; 83 | 84 | $d = "null"; 85 | var_dump($d); 86 | echo $d."

"; 87 | 88 | $e = null; 89 | var_dump($e); 90 | echo $e."

"; 91 | 92 | ?> 93 | 94 |
95 | -------------------------------------------------------------------------------- /l34Crud/updateProfile.php: -------------------------------------------------------------------------------- 1 | query($query); 12 | $userData = $getUserData->fetch_object(); 13 | ?> 14 |
15 |
16 | 17 |
18 |

Update Profile

19 | 22 |
23 | 26 |
27 | 28 |
29 | 30 |
31 | 34 |
35 | 36 | 37 |
38 | 39 |
40 |
41 | 42 |
43 |
44 | 45 | 48 |
49 | 50 |
51 |
52 |
53 |
54 | 55 | 58 | -------------------------------------------------------------------------------- /l30.session-p3.php: -------------------------------------------------------------------------------- 1 | "123456", 6 | "abir@dipti.com.bd" => "123456", 7 | "kaka@chacha.com" => "123456", 8 | ]; 9 | function safe($data) 10 | { 11 | $data = htmlspecialchars($data); 12 | $data = trim($data); 13 | $data = stripslashes($data); 14 | return $data; 15 | } 16 | if(isset($_POST['sub123']) && $_SERVER['REQUEST_METHOD'] === "POST"){ 17 | $email = safe($_POST['email']); 18 | $pass = safe($_POST['pass']); 19 | if(empty($email)){ 20 | $err["email"] = "Please write your email address"; 21 | }elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { 22 | $err["email"] = "Invalid email address"; 23 | } 24 | 25 | if(empty($pass)){ 26 | $err['pass'] = "Please provide your password"; 27 | }elseif(strlen($pass) < 6){ 28 | $err['pass'] = "Please provide a strong password"; 29 | } 30 | 31 | if(count($err) === 0){ 32 | if(isset($users[$email]) && $users[$email] === $pass){ 33 | $_SESSION['uemail'] = $email; 34 | }else{ 35 | $err['login'] = "Invalid user info"; 36 | } 37 | 38 | } 39 | } 40 | 41 | if(isset($_GET['logout']) && $_GET['logout'] === "142"){ 42 | session_unset(); 43 | header("location: ".basename($_SERVER['PHP_SELF'])); 44 | } 45 | ?> 46 | 47 | 48 | 49 | 50 | 51 | 52 | Session 53 | 54 | 55 | 56 | 57 | 60 |

Login Form

61 |
62 | 63 | 64 | 65 |
66 | $errs"; 69 | } 70 | }else{ 71 | ?> 72 |

Welcome

73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /hw/apr-18-2022/hw_abuzar/htmlUnderPhp.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 24 | 25 | 26 | 27 | 32 |

Sir Isaac Newton

33 |
34 | Sir Isaac Newton PRS (25 December 1642 – 20 March 1726/27[a]) was an English mathematician, physicist, astronomer, alchemist, theologian, and author (described in his time as a "natural philosopher") widely recognised as one of the greatest mathematicians and physicists of all time and among the most influential scientists. lm Leibniz for developing infinitesimal calculus. 35 |

36 |
37 | 38 | 39 | 40 |

Albert Einstein

41 |
Albert Einstein (/ˈaɪnstaɪn/ EYEN-styne;[6] German, 14 March 1879 – 18 April 1955) was a German-born theoretical physicist,[7] widely acknowledged to be one of the greatest and most influential physicists of all time. Einstein is best known for developing the theory of relativity, but he also made important contributions to the development of the theory of quantum mechanics. Relativity and quantum mechanics are together the two pillars of modern physics. His mass–energy equivalence formula E = mc2, which arises from relativity theory, has been dubbed "the world's most famous equation".

42 |
43 | 44 | 45 |

Galileo di Vincenzo Bonaiuti de' Galilei

46 |
Galileo di Vincenzo Bonaiuti de' Galilei, commonly referred to as Galileo, was an Italian astronomer, physicist and engineer, sometimes described as a polymath, from the city of Pisa, then part of the Duchy of Florence.[4] Galileo has been called the "father" of observational astronomy,[5] modern physics,[6][7] the scientific method,[8] and modern science.[9]

47 |
48 | 49 | 50 | 51 | 52 |

53 | 54 | "> 55 | 56 | 57 | "> 58 | 59 | 60 | "> 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /l34Crud/sideBar.php: -------------------------------------------------------------------------------- 1 |
2 |

Admin Panel

3 |
4 |
5 |

6 | 16 |

17 |
" 20 | aria-labelledby="headingOne" 21 | data-bs-parent="#accordionExample" 22 | > 23 |
24 |
25 | ">User List 26 | ">Add New User 27 |
28 |
29 |
30 |
31 |
32 |

33 | 43 |

44 |
" 47 | aria-labelledby="headingTwo" 48 | data-bs-parent="#accordionExample" 49 | > 50 |
51 | 56 |
57 |
58 |
59 |
60 |
-------------------------------------------------------------------------------- /hw/apr-11-2022/hw_abuzar/two.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | page_2 8 | 9 | 64 | 65 | 66 | 67 |
68 | 73 | 74 |

অনেক ব্যবধানে এগিয়ে বিশ্বসেরা ধনী ইলন মাস্ক


75 |
দ্বিতীয় অবস্থানে থাকা অ্যামাজনের প্রতিষ্ঠাতা জেফ বেজোসের তুলনায় ১০০ বিলিয়ন ডলার বেশি সম্পদ নিয়ে বিশ্বের সেরা ধনীর তালিয়ায় শীর্ষ স্থানে রয়েছেন টেসলা ও স্পেস এক্সের মতো প্রতিষ্ঠানের প্রতিষ্ঠাতা ইলন মাস্ক। ৫০ বছর বয়সী মাস্কের সম্পদের পরিমাণ প্রায় ৩০০ বিলিয়ন ডলার (প্রায় ২৫ লাখ ৫০ হাজার কোটি টাকা)।
মার্কিন ম্যাগাজিন ফোর্বস প্রকাশিত তালিকার সর্বশেষ সংস্করণে এই তথ্য জানা যায়। খবর সিএনএনের। 76 | সিএনএনের প্রতিবেদন অনুযায়ী, ইলন মাস্ক এখন কালজয়ী বিনিয়োগকারী ও বার্কশায়ার হ্যাথাওয়ের সিইও ওয়ারেন বাফেটের চেয়ে দ্বিগুণেরও বেশি সম্পদের মালিক। মাইক্রোসফটের দুই সাবেক সিইও বিল গেটস (১৩৬ বিলিয়ন) ও স্টিভ বলমারের (১০০ বিলিয়ন) সমন্বিত সম্পদের চেয়েও ইলন মাস্কের সম্পদ বেশি। একই কথা বলা যায় গুগলের সহ-প্রতিষ্ঠাতা ল্যারি পেজ (১২০ বিলিয়ন) ও সের্গেই ব্রিনের (১১৫ বিলিয়ন) ক্ষেত্রেও। বিশ্বব্যাংকের হিসাব অনুসারে, মাস্কের সম্পদ তার নিজ দেশ দক্ষিণ আফ্রিকার মোট দেশজ উৎপাদনের চেয়ে মাত্র ৩৫ বিলিয়ন ডলার কম। মাস্কের মোট সম্পদ কলম্বিয়া, ফিনল্যান্ড, পাকিস্তান, পাকিস্তান, চিলি ও পর্তুগালের জিডিপিকে ছাড়িয়ে গেছে।
77 | 78 | 79 |

80 |
81 | 82 |
83 | 84 |
85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /l20.formValidation.php: -------------------------------------------------------------------------------- 1 | Your Name : $uname "; 38 | $msg[] = "
Your Email : $uemail
"; 39 | $msg[] = "
Your Gender : $gndr
"; 40 | $skills = array_intersect($skillList, $skills); 41 | $msg[] = "
Your Skills : ".implode(", ",$skills)."
" ; 42 | $uname = $uemail = $gndr = $skills = null; 43 | } 44 | } 45 | ?> 46 |
47 | 48 |

49 | 50 | 51 |

52 | 53 | 54 | 55 | 56 |

57 | 58 | 59 | 60 | 61 | 62 | 63 |

64 | 65 | 66 |
67 | $er"; 70 | } 71 | foreach($msg as $ms){ 72 | echo $ms; 73 | } 74 | ?> 75 | -------------------------------------------------------------------------------- /l12.array.php: -------------------------------------------------------------------------------- 1 | "; 5 | echo "
";
  6 |     print_r($person);
  7 |     echo "
"; 8 | 9 | $insittute = ["Daffodil", "Dhaka", "Bangladesh"]; 10 | echo $insittute[2]."
"; 11 | echo "
";
 12 |     print_r($insittute);
 13 |     echo "
"; 14 | 15 | echo count($insittute)."
"; 16 | 17 | for ($i=0; $i < count($insittute); $i++) { 18 | echo $insittute[$i]." "; 19 | } 20 | echo "
"; 21 | 22 | foreach ($insittute as $int) { 23 | echo $int." "; 24 | } 25 | echo "
"; 26 | // associative array 27 | $student = ["name"=>"Amit Gosh", "age"=>25, "area"=>"Dhaka"]; 28 | echo $student["name"]; 29 | echo "
";
 30 |     print_r($student);
 31 |     echo "
"; 32 | echo count($student)."
"; 33 | foreach ($student as $inName => $stdData) { 34 | echo ucfirst($inName)." : ".$stdData."
"; 35 | } 36 | 37 | // multidimentional array 38 | $students = [ 39 | ["Amit", "Dhaka", "Male", 25], 40 | ["Turzo", "Dhaka", "Male", 25], 41 | ["Abuzar", "Dhaka", "Male", 24] 42 | ]; 43 | echo $students[2][0]; 44 | echo "
";
 45 |     print_r($students);
 46 |     echo "
"; 47 | 48 | for ($i=0; $i < count($students); $i++) { 49 | for ($j=0; $j < count($students[$i]); $j++) { 50 | echo $students[$i][$j]." "; 51 | } 52 | echo "
"; 53 | } 54 | 55 | foreach($students as $student){ 56 | foreach($student as $std){ 57 | echo $std." "; 58 | } 59 | echo "
"; 60 | } 61 | 62 | $persons = [ 63 | ["name"=>"Akbar", "age"=>"69", "city"=>"Dhaka"], 64 | ["name"=>"Asif", "age"=>"36", "city"=>"Dhaka"], 65 | ]; 66 | echo $persons[1]["name"]; 67 | echo "
";
 68 |     print_r($persons);
 69 |     echo "
"; 70 | 71 | for ($i=0; $i < count($persons); $i++) { 72 | foreach($persons[$i] as $person){ 73 | echo $person." "; 74 | } 75 | echo "
"; 76 | } 77 | 78 | foreach ($persons as $proson) { 79 | foreach($proson as $person){ 80 | echo $person." "; 81 | } 82 | echo "
"; 83 | } 84 | 85 | $employees = [ 86 | "names" => ["Kamal", "Jamal", "Tomal", "Akmal", "Mal", "Amit"], 87 | "ages" => [35, 25, 45, 40, 75, 25], 88 | "designations" => ["CEO", "Director", "Manager", "Executive", "Owner", "Student"] 89 | ]; 90 | 91 | foreach ($employees as $kachaBadam => $employee){ 92 | foreach($employee as $data){ 93 | echo ucfirst(substr($kachaBadam, 0, -1))." : ".$data." "; 94 | } 95 | echo "
"; 96 | } 97 | 98 | $totalData = count($employees); 99 | $x = 0; 100 | for ($j=0; $j < count($employees["names"]); $j++) { 101 | $y = 1; 102 | foreach ($employees as $kachaBadam => $employee){ 103 | for ($i = $x; $i < $x+1; $i++){ 104 | $coma = ($y < $totalData)?", ": null; 105 | echo ucfirst(substr($kachaBadam, 0, -1))." : ".$employee[$i].$coma; 106 | } 107 | $y++; 108 | } 109 | echo "
"; 110 | $x++; 111 | } 112 | ?> -------------------------------------------------------------------------------- /l34Crud/userlist.php: -------------------------------------------------------------------------------- 1 | query($selectAllUsersQuery); 9 | 10 | $totalResult = $selectAllUsers->num_rows; 11 | $userPerPage = 5; 12 | $pageNo = $_GET['page'] ?? header("location: $page?page=1"); 13 | $pageNo = (int) $pageNo; 14 | $totalPage = ceil($totalResult / $userPerPage); 15 | $startPoint = ($pageNo - 1) * $userPerPage; 16 | 17 | $usersQuery = "SELECT * FROM `users` LIMIT $startPoint, $userPerPage"; 18 | $users = $conn->query($usersQuery); 19 | 20 | $SN = $startPoint + 1; 21 | ?> 22 |
23 |
24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | fetch_object()){ ?> 35 | 36 | 37 | 38 | 39 | 47 | 48 | 49 |
Sl.N.NameEmailAction
name ?>email ?> 40 | id" ?>" class="btn btn-warning"> 41 | 42 | 43 | 44 | 45 | 46 |
50 |
    51 |
  • 52 | 55 |
  • ">
  • 56 | 57 |
  • 58 |
59 | query($query); 64 | $data = $data->fetch_object(); 65 | ?> 66 |
67 |

Update User

68 | 72 |
73 | 77 |
78 | 79 | 80 |
81 | 82 |
83 | 84 |
85 |
86 | 87 | 88 | 89 | 108 | 109 |
110 |
111 |
112 | 113 | 116 | -------------------------------------------------------------------------------- /hw/Jun-6-2022/13_form_abuzar/abuzar.php: -------------------------------------------------------------------------------- 1 | 2 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | PHP Form Validation 74 | 75 | 76 | 77 | 78 | 79 | 80 |
81 |
82 |
83 |

Registration

84 |
85 | 86 | 87 |
88 | 89 | 90 | 91 |
92 |
93 |
94 | 95 |
96 | 97 | 98 | 99 |
100 |
101 |
102 | 103 | 104 |
105 |
"> 106 |
107 | 108 |
109 | 110 |
111 | 114 |
115 | 116 | 117 |
118 | 121 |
122 |
123 |
124 |
125 | 126 |
127 | 128 | 129 |
130 |
" > 131 |
132 | 133 |
134 | 135 |
136 | 139 |
140 | 141 |
142 | 145 |
146 | 147 |
148 | 151 |
152 | 153 |
154 | 157 |
158 |
159 |
160 |
161 |
162 |
163 | 164 | 165 |
166 | 167 |
168 | 169 | 170 |
171 |
172 |
173 |
174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /hw/may-16-2022/13_form_abuzar/abuzar.php: -------------------------------------------------------------------------------- 1 | 2 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | PHP Form Validation 74 | 75 | 76 | 77 | 78 | 79 | 80 |
81 |
82 |
83 |

Registration

84 |
85 | 86 | 87 |
88 | 89 | 90 | 91 |
92 |
93 |
94 | 95 |
96 | 97 | 98 | 99 |
100 |
101 |
102 | 103 | 104 |
105 |
"> 106 |
107 | 108 |
109 | 110 |
111 | 114 |
115 | 116 | 117 |
118 | 121 |
122 |
123 |
124 |
125 | 126 |
127 | 128 | 129 |
130 |
" > 131 |
132 | 133 |
134 | 135 |
136 | 139 |
140 | 141 |
142 | 145 |
146 | 147 |
148 | 151 |
152 | 153 |
154 | 157 |
158 |
159 |
160 |
161 |
162 |
163 | 164 | 165 |
166 | 167 |
168 | 169 | 170 |
171 |
172 |
173 |
174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /l21.formValidation.php: -------------------------------------------------------------------------------- 1 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | PHP Form Validation 63 | 67 | 68 | 69 |
70 |
71 |
72 |

Sign-up Form

73 |
74 |
75 | 83 | 84 |
85 |
86 |
87 |
88 | 96 | 97 |
98 |
99 |
100 |
101 |
102 |
103 | 104 |
105 |
106 | 117 |
118 |
119 | 130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | 139 |
140 |
141 | 152 |
153 |
154 | 165 |
166 |
167 | 178 |
179 |
180 | 191 |
192 |
193 |
194 |
195 |
196 |
197 | 203 |
204 |
205 |
206 |
207 |
208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /l34Crud/formSubmit.php: -------------------------------------------------------------------------------- 1 | real_escape_string($email); 12 | } 13 | 14 | if(empty($pass)){ 15 | $err[] = "Please write your password"; 16 | }else{ 17 | $pass = md5($pass); 18 | $crrPass = $conn->real_escape_string($pass); 19 | } 20 | 21 | if(!empty($crrEmail) and !empty($crrPass)){ 22 | $checkUser = $conn->query("SELECT * FROM `users` WHERE `email` = '$crrEmail' AND `pass` = '$crrPass'"); 23 | if($checkUser->num_rows === 1){ 24 | $userData = $checkUser->fetch_object(); 25 | $_SESSION['user'] = ["id" => "$userData->id","name" => "$userData->name", "email" => "$userData->email", "role" => "$userData->role"]; 26 | unset($err); 27 | echo ""; 28 | header("location: ./index.php"); 29 | }else{ 30 | $err[] = "Invalid user or password"; 31 | } 32 | } 33 | } 34 | if($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['addUser123'])){ 35 | $name = safe($_POST['name']); 36 | $email = safe($_POST['email']); 37 | $pass = safe($_POST['pass']); 38 | if(empty($email)){ 39 | $err[] = "Please write user email address"; 40 | }elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){ 41 | $err[] = "Invalid Email Address"; 42 | }else{ 43 | $email = $conn->real_escape_string($email); 44 | $CheckPreEmail = $conn->query("SELECT * FROM `users` WHERE `email` = '$email'"); 45 | if($CheckPreEmail->num_rows > 0){ 46 | $err[] = "Email address already exicts"; 47 | }else{ 48 | $crrEmail = $conn->real_escape_string($email); 49 | } 50 | } 51 | 52 | if(empty($name)){ 53 | $err[] = "Please write the user name"; 54 | }elseif(!preg_match("/^[A-Za-z. ]*$/", $name)){ 55 | $err[] = "Invalid Name Format"; 56 | }else{ 57 | $crrName = $conn->real_escape_string($name); 58 | } 59 | 60 | if(empty($pass)){ 61 | $err[] = "Please write your password"; 62 | }else{ 63 | $pass = md5($pass); 64 | $crrPass = $conn->real_escape_string($pass); 65 | } 66 | 67 | if(!empty($crrEmail) and !empty($crrPass) and !empty($crrName)){ 68 | $insertUser = $conn->query("INSERT INTO `users` (`name`, `email`, `pass`, `role`) VALUES ('$crrName', '$crrEmail', '$crrPass', 'user')"); 69 | 70 | if(!$insertUser){ 71 | $err[] = "Something went wrong"; 72 | }else{ 73 | echo ""; 74 | $name = $email = $pass = null; 75 | } 76 | } 77 | } 78 | 79 | if(isset($_POST['upUser']) && $_SERVER['REQUEST_METHOD'] === 'POST'){ 80 | $upUserEmail = safe($_POST['upUserEmail']); 81 | $preEmail = safe($_POST['preEmail']); 82 | $uid = safe($_POST['uid']); 83 | if(empty($upUserEmail)){ 84 | $err[] = "Please write user email address"; 85 | }elseif(!filter_var($upUserEmail, FILTER_VALIDATE_EMAIL)){ 86 | $err[] = "Invalid Email Address"; 87 | }elseif($upUserEmail === $preEmail){ 88 | $err[] = "You provide your old email address"; 89 | }else{ 90 | $upUserEmail = $conn->real_escape_string($upUserEmail); 91 | $CheckPreEmail = $conn->query("SELECT * FROM `users` WHERE `email` = '$upUserEmail'"); 92 | if($CheckPreEmail->num_rows > 0){ 93 | $err[] = "Email address already exicts"; 94 | }else{ 95 | $crrEmail = $conn->real_escape_string($upUserEmail); 96 | $uid = $conn->real_escape_string($uid); 97 | $query = "UPDATE `users` SET `email` = '$crrEmail' WHERE `id` = $uid"; 98 | $update = $conn->query($query); 99 | if(!$update){ 100 | $err[] = "Something went wrong"; 101 | }else{ 102 | $pageNo = $_GET['page']; 103 | echo ""; 104 | } 105 | } 106 | } 107 | } 108 | 109 | if(isset($_POST['delUser'])){ 110 | $delUserId = safe($_POST['delUserId']); 111 | $query = "DELETE FROM `users` WHERE `id` = $delUserId"; 112 | $delete = $conn->query($query); 113 | if(!$delete){ 114 | $err[] = "Something went wrong"; 115 | }else{ 116 | $pageNo = $_GET['page']; 117 | echo ""; 118 | } 119 | } 120 | 121 | if(isset($_POST['upPass123'])){ 122 | $oldPass = safe($_POST['oldPass']); 123 | $newPass = safe($_POST['newPass']); 124 | $conformNewPAss = safe($_POST['conformNewPAss']); 125 | $email = safe($_POST['email']); 126 | if(empty($oldPass)){ 127 | $err[] = "Please provide the old password"; 128 | }else{ 129 | $query = "SELECT * FROM `users` WHERE `email` = '$email'"; 130 | $getUserData = $conn->query($query); 131 | $user = $getUserData->fetch_object(); 132 | $id = $user->id; 133 | $convertedOldPass = md5($conn->real_escape_string($oldPass)); 134 | if($convertedOldPass !== $user->pass){ 135 | $err[] = "Old Password is not currect!"; 136 | }else{ 137 | $crrOldPas = $conn->real_escape_string($oldPass); 138 | } 139 | } 140 | 141 | 142 | if(empty($newPass)){ 143 | $err[] = "Please write the new password"; 144 | }elseif($oldPass === $newPass){ 145 | $err[] = "You provide your old password"; 146 | }elseif (strlen($newPass) < 6){ 147 | $err[] = "Please provide a strong password"; 148 | }else{ 149 | $crrNewPas = $conn->real_escape_string($newPass); 150 | } 151 | 152 | if(empty($conformNewPAss)){ 153 | $err[] = "Please provide the confirm password"; 154 | }elseif($newPass !== $conformNewPAss){ 155 | $err[] = "Confirm password didnot matched with the new password"; 156 | }else{ 157 | $crrConformNewPAss = $conn->real_escape_string($conformNewPAss); 158 | } 159 | 160 | if(isset($crrOldPas) && isset($crrNewPas) && isset($crrConformNewPAss)){ 161 | $crrConformNewPAss = md5($crrConformNewPAss); 162 | $query = "UPDATE `users` SET `pass` = '$crrConformNewPAss' WHERE `id` = '$id'"; 163 | $upPass = $conn->query($query); 164 | if(!$upPass){ 165 | $err[] = "Something went wrong"; 166 | }else{ 167 | echo ""; 168 | $oldPass = $newPass = $conformNewPAss = null; 169 | } 170 | } 171 | } 172 | 173 | if(isset($_POST['upPro123'])){ 174 | $name = safe($_POST['name']); 175 | $email = safe($_POST['email']); 176 | $id = safe($_POST['id']); 177 | $oldEmail = safe($_POST['oldEmail']); 178 | $realName = $_FILES['img']['name']; 179 | $tmpName = $_FILES['img']['tmp_name']; 180 | 181 | if(empty($name)){ 182 | $err[] = "Please provide your name"; 183 | }elseif(!preg_match('/^[A-Za-z. ]*$/', $name)){ 184 | $err[] = "Invalid name"; 185 | }else{ 186 | $crrName = $conn->real_escape_string($name); 187 | } 188 | 189 | if(empty($email)){ 190 | $err[] = "Please provide your email"; 191 | }elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)){ 192 | $err[] = "Invalid email"; 193 | }else{ 194 | if($email !== $oldEmail){ 195 | $checkEmailQuery = "SELECT * FROM `users` WHERE `email` = '$email'"; 196 | $checkEmail = $conn->query($checkEmailQuery); 197 | if($checkEmail->num_rows > 0){ 198 | $err[] = "Email Already exicts"; 199 | }else{ 200 | $crrEmail = $conn->real_escape_string($email); 201 | } 202 | }else{ 203 | $crrEmail = $conn->real_escape_string($email); 204 | } 205 | } 206 | 207 | if(!empty($crrName) && !empty($crrEmail)){ 208 | if(!empty($tmpName)){ 209 | if(!getimagesize($tmpName)){ 210 | $err[] = "Please select an image file"; 211 | }else{ 212 | if(!file_exists("./images")){ 213 | mkdir("./images"); 214 | } 215 | $alfa = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 216 | $sflAlfa = str_shuffle($alfa); 217 | $randomVal = substr($sflAlfa, 0, 6); 218 | $randomName = $randomVal.uniqid().date("ahisFdYl"); 219 | $randomName = $randomName.basename($realName); 220 | $muf = move_uploaded_file($tmpName, "images/$randomName"); 221 | if(!$muf){ 222 | $err[] = "Image upload problem"; 223 | }else{ 224 | $img = $randomName; 225 | } 226 | } 227 | }else{ 228 | $id = (int) $conn->real_escape_string($id); 229 | $getImgData = "SELECT `img` FROM `users` WHERE `id` = $id"; 230 | $preImgData = $conn->query($getImgData); 231 | $preImg = $preImgData->fetch_object(); 232 | $img = $preImg->img; 233 | } 234 | $query = "UPDATE `users` SET `name` = '$crrName', `email` = '$crrEmail', `img` = '$img' WHERE `id` = $id"; 235 | $updateUser = $conn->query($query); 236 | if(!$updateUser){ 237 | $err[] = "Something went wrong"; 238 | }else{ 239 | $_SESSION['user']['name'] = $crrName; 240 | $_SESSION['user']['email'] = $crrEmail; 241 | echo ""; 242 | } 243 | } 244 | } 245 | 246 | function safe ($data) 247 | { 248 | $data = htmlspecialchars($data); 249 | $data = trim($data); 250 | $data = stripslashes($data); 251 | return $data; 252 | } 253 | ?> --------------------------------------------------------------------------------