├── b76.sql ├── bac75.sql ├── footer.php ├── header.php ├── hw ├── Mahmudunnabi │ └── Mahmudunnabi │ │ └── leap_year.php └── Md Tazul islam │ └── leapyear │ ├── image │ └── Leap_Year_Algorithm.png │ └── leapyear.php ├── images ├── 8tdEa5C20Au0FA2Su1aBg2a2Dtry160S62ee2b90a4c9261c1df0f81e93304b252e33d_google-search-central-logo.png ├── C82dABt026S0DyFr1uA5S12gt2aa0uEa62ee2b90a6ddddownload.png ├── D0r0128tE0ySatF56S1aCa2B2uug2AdA62ee2b90a4f14364-3642224_clarity-ecommerce-logo-logo-e-commerce-png.png ├── guB082E52Ay0Sad0CtDuA62aF1at1Sr262ee2b90a56cb1540267867863.jpg ├── u2BFAgat25SC0aS0u211yEtA0a28d6rD62ee2b90a70adReact-icon.svg.png └── uD60tg58tu2aA2EAd2C11FaSySrB2a0062ee2b90a62dfblue-1343159_1280.webp ├── l1-echo-print.php ├── l10-function.php ├── l11loop.php ├── l12trycatch.php ├── l13-array.php ├── l14-date.php ├── l15-superGlobal.php ├── l16-getMethod.php ├── l17-form-1.php ├── l18-file-upload.php ├── l19-session-1.php ├── l19-session-2.php ├── l2.variable.php ├── l20-login-system.php ├── l21-revice.php ├── l22-oop-class.php ├── l23-inheritenceClass.php ├── l24-access-modifire.php ├── l25-con-des.php ├── l26.oop-types.php ├── l27-static-oop.php ├── l28-const.oop.php ├── l29-stop-con-obj-oop.php ├── l3.const.php ├── l30.abstract-oop.php ├── l31.interface-oop.php ├── l32-traits-oop.php ├── l33-sql-quries.php ├── l34-connect-with-mysql.php ├── l35-crud.php ├── l4.comment.php ├── l5-datatype.php ├── l6-operators.php ├── l7-math.php ├── l8-string.php ├── l9-condition.php ├── problem.js ├── problem.php └── simplecrud ├── add.php ├── del.php ├── index.php └── up.php /b76.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 5.1.0 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Host: 127.0.0.1 6 | -- Generation Time: Sep 01, 2022 at 10:19 AM 7 | -- Server version: 10.4.18-MariaDB 8 | -- PHP Version: 8.0.3 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | START TRANSACTION; 12 | SET time_zone = "+00:00"; 13 | 14 | 15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 18 | /*!40101 SET NAMES utf8mb4 */; 19 | 20 | -- 21 | -- Database: `b76` 22 | -- 23 | 24 | -- -------------------------------------------------------- 25 | 26 | -- 27 | -- Table structure for table `students` 28 | -- 29 | 30 | CREATE TABLE `students` ( 31 | `id` int(11) NOT NULL, 32 | `name` char(255) NOT NULL, 33 | `gender` char(100) NOT NULL, 34 | `dob` date NOT NULL, 35 | `religion` char(100) NOT NULL, 36 | `city` char(150) NOT NULL, 37 | `created_at` timestamp NOT NULL DEFAULT current_timestamp() 38 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 39 | 40 | -- 41 | -- Dumping data for table `students` 42 | -- 43 | 44 | INSERT INTO `students` (`id`, `name`, `gender`, `dob`, `religion`, `city`, `created_at`) VALUES 45 | (1, 'Mushfiq Sir', 'Male', '2000-01-03', 'Islam', 'Dhaka', '2022-08-29 09:06:06'), 46 | (2, 'Kamal', 'Male', '0000-00-00', 'Islam', 'Chuyadanga', '2022-08-29 09:08:23'), 47 | (6, 'Aslam Khan', 'Male', '2000-10-09', 'Islam', 'Dhaka', '2022-09-01 07:10:45'), 48 | (7, 'Kamal', 'Male', '2022-01-02', 'Islam', 'Dhaka', '2022-09-01 07:38:08'), 49 | (8, 'Jamal Mia', 'Male', '2022-06-15', 'Islam', 'Dhaka', '2022-09-01 07:38:08'); 50 | 51 | -- -------------------------------------------------------- 52 | 53 | -- 54 | -- Table structure for table `teachers` 55 | -- 56 | 57 | CREATE TABLE `teachers` ( 58 | `id` int(11) NOT NULL, 59 | `name` char(100) DEFAULT NULL, 60 | `subject` char(100) DEFAULT NULL, 61 | `created_at` timestamp NOT NULL DEFAULT current_timestamp() 62 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 63 | 64 | -- 65 | -- Indexes for dumped tables 66 | -- 67 | 68 | -- 69 | -- Indexes for table `students` 70 | -- 71 | ALTER TABLE `students` 72 | ADD PRIMARY KEY (`id`); 73 | 74 | -- 75 | -- Indexes for table `teachers` 76 | -- 77 | ALTER TABLE `teachers` 78 | ADD PRIMARY KEY (`id`); 79 | 80 | -- 81 | -- AUTO_INCREMENT for dumped tables 82 | -- 83 | 84 | -- 85 | -- AUTO_INCREMENT for table `students` 86 | -- 87 | ALTER TABLE `students` 88 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; 89 | COMMIT; 90 | 91 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 92 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 93 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 94 | -------------------------------------------------------------------------------- /bac75.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 5.1.0 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Host: 127.0.0.1 6 | -- Generation Time: Sep 01, 2022 at 10:20 AM 7 | -- Server version: 10.4.18-MariaDB 8 | -- PHP Version: 8.0.3 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | START TRANSACTION; 12 | SET time_zone = "+00:00"; 13 | 14 | 15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 18 | /*!40101 SET NAMES utf8mb4 */; 19 | 20 | -- 21 | -- Database: `bac75` 22 | -- 23 | 24 | -- -------------------------------------------------------- 25 | 26 | -- 27 | -- Table structure for table `district` 28 | -- 29 | 30 | CREATE TABLE `district` ( 31 | `SNo` int(11) NOT NULL, 32 | `District` varchar(20) DEFAULT NULL, 33 | `Division` varchar(20) DEFAULT NULL 34 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 35 | 36 | -- 37 | -- Dumping data for table `district` 38 | -- 39 | 40 | INSERT INTO `district` (`SNo`, `District`, `Division`) VALUES 41 | (1, '', ''), 42 | (2, 'Barisal District', 'Barisal'), 43 | (3, 'Bhola District', 'Barisal'), 44 | (4, 'Jhalokati District', 'Barisal'), 45 | (5, 'Patuakhali District', 'Barisal'), 46 | (6, 'Pirojpur District', 'Barisal'), 47 | (7, 'Bandarban District', 'Chittagong'), 48 | (8, 'Brahmanbaria Distric', 'Chittagong'), 49 | (9, 'Chandpur District', 'Chittagong'), 50 | (10, 'Chittagong District', 'Chittagong'), 51 | (11, 'Comilla District', 'Chittagong'), 52 | (12, 'Cox\'s Bazar District', 'Chittagong'), 53 | (13, 'Feni District', 'Chittagong'), 54 | (14, 'Khagrachhari Distric', 'Chittagong'), 55 | (15, 'Lakshmipur District', 'Chittagong'), 56 | (16, 'Noakhali District', 'Chittagong'), 57 | (17, 'Rangamati District', 'Chittagong'), 58 | (18, 'Dhaka District', 'Dhaka'), 59 | (19, 'Faridpur District', 'Dhaka'), 60 | (20, 'Gazipur District', 'Dhaka'), 61 | (21, 'Gopalganj District', 'Dhaka'), 62 | (22, 'Jamalpur District', 'Dhaka'), 63 | (23, 'Kishoreganj District', 'Dhaka'), 64 | (24, 'Madaripur District', 'Dhaka'), 65 | (25, 'Manikganj District', 'Dhaka'), 66 | (26, 'Munshiganj District', 'Dhaka'), 67 | (27, 'Mymensingh District', 'Dhaka'), 68 | (28, 'Narayanganj District', 'Dhaka'), 69 | (29, 'Narsingdi District', 'Dhaka'), 70 | (30, 'Netrakona District', 'Dhaka'), 71 | (31, 'Rajbari District', 'Dhaka'), 72 | (32, 'Shariatpur District', 'Dhaka'), 73 | (33, 'Sherpur District', 'Dhaka'), 74 | (34, 'Tangail District', 'Dhaka'), 75 | (35, 'Bagerhat District', 'Khulna'), 76 | (36, 'Chuadanga District', 'Khulna'), 77 | (37, 'Jessore District', 'Khulna'), 78 | (38, 'Jhenaidah District', 'Khulna'), 79 | (39, 'Khulna District', 'Khulna'), 80 | (40, 'Kushtia District', 'Khulna'), 81 | (41, 'Magura District', 'Khulna'), 82 | (42, 'Meherpur District', 'Khulna'), 83 | (43, 'Narail District', 'Khulna'), 84 | (44, 'Satkhira District', 'Khulna'), 85 | (45, 'Bogra District', 'Rajshahi'), 86 | (46, 'Joypurhat District', 'Rajshahi'), 87 | (47, 'Naogaon District', 'Rajshahi'), 88 | (48, 'Natore District', 'Rajshahi'), 89 | (49, 'Nawabganj District', 'Rajshahi'), 90 | (50, 'Pabna District', 'Rajshahi'), 91 | (51, 'Rajshahi District', 'Rajshahi'), 92 | (52, 'Sirajganj District', 'Rajshahi'), 93 | (53, 'Dinajpur District', 'Rangpur'), 94 | (54, 'Gaibandha District', 'Rangpur'), 95 | (55, 'Kurigram District', 'Rangpur'), 96 | (56, 'Lalmonirhat District', 'Rangpur'), 97 | (57, 'Nilphamari District', 'Rangpur'), 98 | (58, 'Panchagarh District', 'Rangpur'), 99 | (59, 'Rangpur District', 'Rangpur'), 100 | (60, 'Thakurgaon District', 'Rangpur'), 101 | (61, 'Habiganj District', 'Sylhet'), 102 | (62, 'Moulvibazar District', 'Sylhet'), 103 | (63, 'Sunamganj District', 'Sylhet'), 104 | (64, 'Sylhet District', 'Sylhet'); 105 | 106 | -- -------------------------------------------------------- 107 | 108 | -- 109 | -- Table structure for table `produt` 110 | -- 111 | 112 | CREATE TABLE `produt` ( 113 | `id` int(11) NOT NULL, 114 | `name` varchar(40) DEFAULT NULL, 115 | `price` float(8,2) DEFAULT NULL, 116 | `quantity` int(11) DEFAULT NULL, 117 | `vendorName` varchar(65) DEFAULT NULL, 118 | `mDate` date DEFAULT NULL, 119 | `eDate` date DEFAULT NULL, 120 | `totalAmount` float(8,2) DEFAULT NULL 121 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 122 | 123 | -- 124 | -- Dumping data for table `produt` 125 | -- 126 | 127 | INSERT INTO `produt` (`id`, `name`, `price`, `quantity`, `vendorName`, `mDate`, `eDate`, `totalAmount`) VALUES 128 | (1, 'Mouse', 450.00, 1000, 'Computer Source', '2021-10-01', '2023-10-01', 450000.00), 129 | (2, 'Keyboard', 450.00, 1000, 'Computer Source', '2021-10-01', '2023-10-01', 450000.00), 130 | (3, 'Monitor', 8000.00, 50, 'Computer Source', '2021-10-01', '2023-10-01', 400000.00); 131 | 132 | -- -------------------------------------------------------- 133 | 134 | -- 135 | -- Table structure for table `result` 136 | -- 137 | 138 | CREATE TABLE `result` ( 139 | `id` int(11) NOT NULL, 140 | `html` int(11) DEFAULT NULL, 141 | `css` int(11) DEFAULT NULL, 142 | `bac` int(11) DEFAULT NULL, 143 | `javascript` int(11) DEFAULT NULL, 144 | `stuid` int(11) NOT NULL 145 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 146 | 147 | -- 148 | -- Dumping data for table `result` 149 | -- 150 | 151 | INSERT INTO `result` (`id`, `html`, `css`, `bac`, `javascript`, `stuid`) VALUES 152 | (1, 40, 45, 48, 40, 5), 153 | (2, 50, 40, 48, 35, 4), 154 | (3, 40, 40, 40, 40, 1), 155 | (4, 30, 30, 30, 30, 2), 156 | (5, 45, 45, 45, 45, 3); 157 | 158 | -- -------------------------------------------------------- 159 | 160 | -- 161 | -- Table structure for table `stuinfo` 162 | -- 163 | 164 | CREATE TABLE `stuinfo` ( 165 | `id` int(11) NOT NULL, 166 | `name` varchar(30) DEFAULT NULL, 167 | `email` varchar(30) DEFAULT NULL, 168 | `address` varchar(45) DEFAULT NULL 169 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 170 | 171 | -- 172 | -- Dumping data for table `stuinfo` 173 | -- 174 | 175 | INSERT INTO `stuinfo` (`id`, `name`, `email`, `address`) VALUES 176 | (1, 'Sojib', 'sojib@dipti.com.bd', 'Rayarbag'), 177 | (2, 'Shawn', 'shawn@dipti.com.bd', 'Lalmatia'), 178 | (3, 'Sadat', 'sadat@dipti.com.bd', 'Sobahna Bagh'), 179 | (4, 'Ajoy', 'ajoy@dipti.com.bd', 'Mohammadpur'), 180 | (5, 'Ratul', 'ratul@dipti.com.bd', 'Mirpur'); 181 | 182 | -- 183 | -- Indexes for dumped tables 184 | -- 185 | 186 | -- 187 | -- Indexes for table `district` 188 | -- 189 | ALTER TABLE `district` 190 | ADD PRIMARY KEY (`SNo`); 191 | 192 | -- 193 | -- Indexes for table `produt` 194 | -- 195 | ALTER TABLE `produt` 196 | ADD PRIMARY KEY (`id`); 197 | 198 | -- 199 | -- Indexes for table `result` 200 | -- 201 | ALTER TABLE `result` 202 | ADD PRIMARY KEY (`id`), 203 | ADD KEY `id` (`stuid`); 204 | 205 | -- 206 | -- Indexes for table `stuinfo` 207 | -- 208 | ALTER TABLE `stuinfo` 209 | ADD PRIMARY KEY (`id`); 210 | 211 | -- 212 | -- AUTO_INCREMENT for dumped tables 213 | -- 214 | 215 | -- 216 | -- AUTO_INCREMENT for table `district` 217 | -- 218 | ALTER TABLE `district` 219 | MODIFY `SNo` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65; 220 | 221 | -- 222 | -- AUTO_INCREMENT for table `produt` 223 | -- 224 | ALTER TABLE `produt` 225 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 226 | 227 | -- 228 | -- AUTO_INCREMENT for table `result` 229 | -- 230 | ALTER TABLE `result` 231 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; 232 | 233 | -- 234 | -- AUTO_INCREMENT for table `stuinfo` 235 | -- 236 | ALTER TABLE `stuinfo` 237 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; 238 | 239 | -- 240 | -- Constraints for dumped tables 241 | -- 242 | 243 | -- 244 | -- Constraints for table `result` 245 | -- 246 | ALTER TABLE `result` 247 | ADD CONSTRAINT `id` FOREIGN KEY (`stuid`) REFERENCES `stuinfo` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; 248 | COMMIT; 249 | 250 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 251 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 252 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 253 | -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | 2 |

Amio bir moddhe

3 | 4 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |

Ai Bodir moddhe

-------------------------------------------------------------------------------- /hw/Mahmudunnabi/Mahmudunnabi/leap_year.php: -------------------------------------------------------------------------------- 1 | "; 8 | } elseif ($year % 4 != 0) { 9 | 10 | echo "$year is not a leap year."; 11 | } else if ($year % 100 != 0) { 12 | echo "$year is a leap year."; 13 | } else if ($year % 400 == 0) { 14 | echo "$year is a leap year."; 15 | } else { 16 | echo "$year is not a leap year."; 17 | } 18 | } 19 | 20 | checkYear(2003); 21 | -------------------------------------------------------------------------------- /images/8tdEa5C20Au0FA2Su1aBg2a2Dtry160S62ee2b90a4c9261c1df0f81e93304b252e33d_google-search-central-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b76PHP/2ca9f48da1b9973c4aa3c3f3de899f8cfef5510b/images/8tdEa5C20Au0FA2Su1aBg2a2Dtry160S62ee2b90a4c9261c1df0f81e93304b252e33d_google-search-central-logo.png -------------------------------------------------------------------------------- /images/C82dABt026S0DyFr1uA5S12gt2aa0uEa62ee2b90a6ddddownload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b76PHP/2ca9f48da1b9973c4aa3c3f3de899f8cfef5510b/images/C82dABt026S0DyFr1uA5S12gt2aa0uEa62ee2b90a6ddddownload.png -------------------------------------------------------------------------------- /images/D0r0128tE0ySatF56S1aCa2B2uug2AdA62ee2b90a4f14364-3642224_clarity-ecommerce-logo-logo-e-commerce-png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b76PHP/2ca9f48da1b9973c4aa3c3f3de899f8cfef5510b/images/D0r0128tE0ySatF56S1aCa2B2uug2AdA62ee2b90a4f14364-3642224_clarity-ecommerce-logo-logo-e-commerce-png.png -------------------------------------------------------------------------------- /images/guB082E52Ay0Sad0CtDuA62aF1at1Sr262ee2b90a56cb1540267867863.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b76PHP/2ca9f48da1b9973c4aa3c3f3de899f8cfef5510b/images/guB082E52Ay0Sad0CtDuA62aF1at1Sr262ee2b90a56cb1540267867863.jpg -------------------------------------------------------------------------------- /images/u2BFAgat25SC0aS0u211yEtA0a28d6rD62ee2b90a70adReact-icon.svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b76PHP/2ca9f48da1b9973c4aa3c3f3de899f8cfef5510b/images/u2BFAgat25SC0aS0u211yEtA0a28d6rD62ee2b90a70adReact-icon.svg.png -------------------------------------------------------------------------------- /images/uD60tg58tu2aA2EAd2C11FaSySrB2a0062ee2b90a62dfblue-1343159_1280.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asif-daffodil/b76PHP/2ca9f48da1b9973c4aa3c3f3de899f8cfef5510b/images/uD60tg58tu2aA2EAd2C11FaSySrB2a0062ee2b90a62dfblue-1343159_1280.webp -------------------------------------------------------------------------------- /l1-echo-print.php: -------------------------------------------------------------------------------- 1 | HTML"; 5 | print "eki kaaz korte paren"; 6 | -------------------------------------------------------------------------------- /l10-function.php: -------------------------------------------------------------------------------- 1 | "; 10 | echo dhaka("USA")."
"; 11 | echo dhaka($x)."
"; 12 | 13 | function multiPera ($pera1 = "Ananta", $pera2 = "Jalil") { 14 | return $pera1." ".$pera2; 15 | } 16 | 17 | echo multiPera("Hero", "Alom")."
"; 18 | echo multiPera()."
"; 19 | echo multiPera("Hero")."
"; 20 | echo multiPera(pera2:"Hero", pera1:"Nazmul")."
"; 21 | 22 | $myFunc = fn($msg) => $msg; 23 | 24 | echo $myFunc("Alhadulillah"); 25 | ?> -------------------------------------------------------------------------------- /l11loop.php: -------------------------------------------------------------------------------- 1 | "; 9 | 10 | $startPoint = 9; 11 | while ($startPoint >= 0) { 12 | echo $startPoint." "; 13 | $startPoint--; 14 | } 15 | 16 | $gunok = 2; 17 | $gunitok = 1; 18 | while ($gunitok <= 10){ 19 | echo $gunok." x ".$gunitok." = ".($gunok * $gunitok)."
"; 20 | $gunitok++; 21 | } 22 | 23 | for ($i=0; $i < 10; $i++) { 24 | echo $i." "; 25 | } 26 | echo "
"; 27 | 28 | for ($j=2; $j <= 100; $j += 2) { 29 | echo $j." "; 30 | } 31 | echo "
"; 32 | for ($k=1; $k <= 100; $k++) { 33 | echo ($k % 7 === 0)? $k." ":null; 34 | } 35 | echo "
"; 36 | $count = 0; 37 | for ($l=1; $l <= 100; $l++) { 38 | if($l % 13 === 0){ 39 | $count++; 40 | } 41 | } 42 | echo $count."
"; 43 | 44 | $x = 15; 45 | do{ 46 | echo $x; 47 | $x++; 48 | }while ($x < 10) 49 | ?> -------------------------------------------------------------------------------- /l12trycatch.php: -------------------------------------------------------------------------------- 1 | 1) { 5 | throw new Exception("Value must be 1 or below"); 6 | } 7 | return true; 8 | } 9 | 10 | //trigger exception in a "try" block 11 | try { 12 | checkNum(2); 13 | //If the exception is thrown, this text will not be shown 14 | echo 'If you see this, the number is 1 or below'; 15 | } 16 | 17 | //catch exception 18 | catch(Exception $e) { 19 | echo 'Message: ' .$e->getMessage(); 20 | } 21 | ?> -------------------------------------------------------------------------------- /l13-array.php: -------------------------------------------------------------------------------- 1 | " . $city[0] . "
"; 11 | 12 | echo "
";
13 | print_r($city);
14 | echo "
"; 15 | 16 | echo $city[0] . ", " . $city[1] . ", " . $city[2] . ", " . $city[3] . "
"; 17 | 18 | echo count($city) . "
"; 19 | 20 | for ($i = 0; $i < count($city); $i++) { 21 | $koma = ($i === count($city) - 1) ? "
" : ", "; 22 | echo $city[$i] . $koma; 23 | } 24 | 25 | $i = 0; 26 | foreach ($city as $ct) { 27 | $koma = ($i === count($city) - 1) ? "
" : ", "; 28 | echo $ct . $koma; 29 | $i++; 30 | } 31 | 32 | //Associative array 33 | $personInfo = ["name" => "Asif Abir", "city" => "Dhaka", "Gender" => "Male"]; 34 | echo "
";
35 | var_dump($personInfo);
36 | echo "
"; 37 | echo "
";
38 | print_r($personInfo);
39 | echo "
"; 40 | echo "Name : " . $personInfo["name"] . ", City : " . $personInfo["city"] . ", Gender : " . $personInfo["Gender"] . "
"; 41 | 42 | foreach ($personInfo as $key => $val) { 43 | echo ucwords($key) . " : " . $val . "
"; 44 | } 45 | 46 | 47 | //Multidimntional array 48 | $bd = [["Kamal", "Jamal", "Tomal", "Akmal"], ["Dhaka", "Cumilla", "Chittagong", "Cox Bazar"], [25, 35, 45, 55]]; 49 | 50 | echo "
";
51 | print_r($bd);
52 | echo "
"; 53 | 54 | foreach ($bd as $data) { 55 | foreach ($data as $val) { 56 | echo $val . " "; 57 | } 58 | echo "
"; 59 | } 60 | 61 | for ($i = 0; $i < count($bd); $i++) { 62 | for ($j = 0; $j < count($bd[$i]); $j++) { 63 | echo $bd[$i][$j] . " "; 64 | } 65 | echo "
"; 66 | } 67 | 68 | echo $bd[0][1] . "
"; 69 | 70 | $persons = [ 71 | "names" => ["Abul", "Babul", "Kabul", "Mokbul", "Bulbul"], 72 | "cities" => ["Dhaka", "Chadpur", "Bandarban", "Dinajour", "Pirojpur"], 73 | "ages" => [10, 12, 6, 60, 35] 74 | ]; 75 | 76 | $text = [" lives in", " and his age is ", "."]; 77 | foreach ($persons as $person) { 78 | foreach ($person as $info) { 79 | echo $info . " "; 80 | } 81 | echo "
"; 82 | } 83 | 84 | $totalData = count($persons["names"]); 85 | 86 | for ($i = 0; $i < $totalData; $i++) { 87 | echo $persons["names"][$i] . $text[0] . $persons["cities"][$i] . $text[1] . $persons["ages"][$i] . $text[2] . "
"; 88 | } 89 | -------------------------------------------------------------------------------- /l14-date.php: -------------------------------------------------------------------------------- 1 | "; 3 | echo date("d/m/y") . "
"; 4 | echo date("d/M/y") . "
"; 5 | date_default_timezone_set("Asia/Dhaka"); 6 | echo date_default_timezone_get() . "
"; 7 | echo date("d/F/Y h:i:s a") . "
"; 8 | echo date("d/F/Y H:i:s") . "
"; 9 | echo date("d/F/Y h:i:s A") . "
"; 10 | echo date("d/F/Y h:i:s A D") . "
"; 11 | echo date("d/F/Y h:i:s A l") . "
"; 12 | 13 | //mktime 14 | // hour minute second month day year 15 | 16 | $myTime = mktime(15, 39, 47, 9, 12, 2009); 17 | echo date("d/F/Y h:i:s A l", $myTime) . "
"; 18 | $myTime2 = mktime(0, 0, 0, 5, 5, 2015); 19 | echo date("d/F/Y h:i:s A l", $myTime2) . "
"; 20 | 21 | //strtotime 22 | 23 | $nextFriday = strtotime("next friday"); 24 | echo date("d/F/Y h:i:s A l", $nextFriday) . "
"; 25 | 26 | $nextday = strtotime("tomorrow"); 27 | echo date("d/F/Y h:i:s A l", $nextday) . "
"; 28 | 29 | $previousDay = strtotime("yesterday"); 30 | echo date("d/F/Y h:i:s A l", $previousDay) . "
"; 31 | 32 | $myDate = strtotime("-2 years +3 month -1 week +2 days"); 33 | echo date("d/F/Y h:i:s A l", $myDate) . "
"; 34 | 35 | $startDate = strtotime("next friday"); 36 | $endDate = strtotime("+6 weeks", $startDate); 37 | 38 | while ($startDate <= $endDate) { 39 | echo date("d/F/Y l", $startDate) . "
"; 40 | $startDate = strtotime("+1 weeks", $startDate); 41 | } 42 | -------------------------------------------------------------------------------- /l15-superGlobal.php: -------------------------------------------------------------------------------- 1 | "; 12 | 13 | 14 | // $_SERVER[]; 15 | echo "
";
16 | print_r($_SERVER);
17 | echo "
"; 18 | 19 | echo $_SERVER["PHP_SELF"] . "
"; 20 | echo $_SERVER["REQUEST_METHOD"]; 21 | -------------------------------------------------------------------------------- /l16-getMethod.php: -------------------------------------------------------------------------------- 1 | "; 5 | ?> 6 | "> 7 | 8 | 9 | "> 10 | 11 | 12 | "> 13 | 14 | 15 | "> 16 | 17 | 18 | "> 19 | 20 | -------------------------------------------------------------------------------- /l17-form-1.php: -------------------------------------------------------------------------------- 1 | Please provide the user name"; 14 | }elseif(!preg_match("/^[A-Za-z. ]*$/", $uname)){ 15 | $errs["name"] = "Invalid user name"; 16 | }else{ 17 | $crrUname = $uname; 18 | } 19 | 20 | if(empty($uemail)) { 21 | $errs["email"] = "Please provide the email address"; 22 | }elseif(!filter_var($uemail, FILTER_VALIDATE_EMAIL)){ 23 | $errs["email"] = "Invalid email address"; 24 | }else{ 25 | $crrUemail = $uemail; 26 | } 27 | 28 | if(empty($gndr)) { 29 | $errs["gndr"] = "Please select your gender"; 30 | }elseif(!in_array($gndr, $genderList)){ 31 | $errs["gndr"] = "Paknami bondho korun"; 32 | }else{ 33 | $crrGndr = $gndr; 34 | } 35 | 36 | if(count($skills) === 0){ 37 | $errs["skill"] = "Please select your skills"; 38 | }else{ 39 | foreach($skills as $skill){ 40 | if(!in_array($skill, $skillList)){ 41 | $errs["skill"] = "Har baap ka ek baap hota hey!"; 42 | } 43 | } 44 | if(!isset($errs["skill"])){ 45 | $crrSkills = $skills; 46 | } 47 | } 48 | 49 | 50 | if(isset($crrUname) && isset($crrUemail) && isset($crrGndr) && isset($crrSkills)){ 51 | foreach($crrSkills as $sk){ 52 | $skillText .= "$sk "; 53 | } 54 | $msg = " 55 |

Your Name: $crrUname
Your Email: $crrUemail
Your Gender : $crrGndr
Skills : $skillText

56 | "; 57 | } 58 | } 59 | function safuda ($data) { 60 | if(gettype($data) === "string"){ 61 | $kata = htmlspecialchars($data); 62 | $data = trim($kata); 63 | $data = stripslashes($data); 64 | return $data; 65 | } 66 | return $data; 67 | } 68 | ?> 69 | 70 | 71 | 72 | 73 | 74 | 75 | Form 1 76 | 77 | 78 |
79 | 80 |

81 | 82 |

83 | Gender : 84 | >Male 85 | >Female 86 |

87 | Skills : 88 | 0 && in_array("HTML", $skills))? "checked":null ?>>HTML 89 | 0 && in_array("CSS", $skills))? "checked":null ?>>CSS 90 | 0 && in_array("JS", $skills))? "checked":null ?>>JS 91 | 0 && in_array("PHP", $skills))? "checked":null ?>>PHP 92 |

93 | 94 |
95 | "; 98 | } 99 | ?> 100 | 101 | 102 | -------------------------------------------------------------------------------- /l18-file-upload.php: -------------------------------------------------------------------------------- 1 | alert('Please choose a file')"; 7 | }else{ 8 | for ($i=0; $i < count($fName); $i++) { 9 | if(!getimagesize($tmpName[$i])){ 10 | echo ""; 11 | }else{ 12 | if (!is_dir("images")) { 13 | mkdir("images"); 14 | } 15 | $alfa = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 16 | $direction = "images/".str_shuffle(substr($alfa, 0, 6).date("hisMdYDl")).uniqid().$fName[$i]; 17 | $move = move_uploaded_file($tmpName[$i], $direction); 18 | if(!$move){ 19 | echo ""; 20 | }else{ 21 | echo ""; 22 | } 23 | } 24 | } 25 | } 26 | } 27 | ?> 28 |
29 | 30 | 31 |
-------------------------------------------------------------------------------- /l19-session-1.php: -------------------------------------------------------------------------------- 1 | "; 11 | echo $uName; 12 | ?> -------------------------------------------------------------------------------- /l19-session-2.php: -------------------------------------------------------------------------------- 1 | "; 6 | // echo $uName; 7 | ?> -------------------------------------------------------------------------------- /l2.variable.php: -------------------------------------------------------------------------------- 1 | 123456, 5 | "jamal"=>123456, 6 | "tomal"=>123456, 7 | "akmal"=>123456, 8 | "mal"=>123456, 9 | ]; 10 | if (isset($_POST['log123'])) { 11 | $uname = safuda($_POST['uname']); 12 | $pass = safuda($_POST['pass']); 13 | 14 | if(empty($uname)){ 15 | $errUser = "Please write your username"; 16 | }elseif(!preg_match("/^[A-Za-z. ]*$/", $uname)){ 17 | $errUser = "Invalid username"; 18 | }else{ 19 | $crrUser = $uname; 20 | } 21 | 22 | if(empty($pass)){ 23 | $errPass = "Please write your password"; 24 | }else{ 25 | $crrPass = $pass; 26 | } 27 | 28 | if(isset($crrUser) && isset($crrPass)){ 29 | if(isset($loginInfo[$crrUser]) && $loginInfo[$crrUser] == $crrPass){ 30 | $_SESSION['uName'] = $crrUser; 31 | }else{ 32 | $errMsg = "
Invalid username or password
"; 33 | } 34 | } 35 | } 36 | 37 | if(isset($_POST['lout123'])){ 38 | session_unset(); 39 | } 40 | function safuda ($data){ 41 | $data = htmlspecialchars($data); 42 | $data = trim($data); 43 | $data = stripslashes($data); 44 | return $data; 45 | } 46 | ?> 47 | 48 | 49 | 50 | 51 | 52 | 53 | Login System 54 | 55 | 56 | 57 | 58 | 61 |
62 |
63 |
64 | Welcome 65 |
66 | 67 |
68 |
69 |
70 |
71 | 72 |
73 |
74 |
75 |

Login Form

76 |
77 |
78 | 83 | 84 | " 85 | name="uname" 86 | value="" 87 | > 88 | 89 |
90 | Username is inputted currectly! 91 |
92 |
93 | 94 |
95 |
96 |
97 | 101 | 102 | " 103 | name="pass" 104 | value="" 105 | > 106 | 107 |
108 | Password is correct! 109 |
110 |
111 | 112 |
113 |
114 |
115 | 116 |
117 |
118 | 119 |
120 |
121 |
122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /l21-revice.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 9 | Hello World 10 | 13 | 14 | 18 | 19 | 32 | 33 |
34 | 35 | 36 |
37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /l22-oop-class.php: -------------------------------------------------------------------------------- 1 | myPro."
".$obj->yourPro; 10 | ?> -------------------------------------------------------------------------------- /l23-inheritenceClass.php: -------------------------------------------------------------------------------- 1 | amGach; 9 | } 10 | } 11 | 12 | class ami extends baba { 13 | public function shudhuAmar () { 14 | return $this->myBaba (); 15 | } 16 | } 17 | 18 | $obj = new ami; 19 | echo $obj->shudhuAmar(); 20 | ?> -------------------------------------------------------------------------------- /l24-access-modifire.php: -------------------------------------------------------------------------------- 1 | myProperty."
".$this->myOtherProperty."
".$this->onliMine; 12 | } 13 | } 14 | 15 | class myChield extends myClass 16 | { 17 | public function myChieldFunc () 18 | { 19 | return $this->myProperty."
".$this->myOtherProperty."
"; 20 | } 21 | } 22 | 23 | $myObj = new myClass; 24 | echo $myObj->myProperty."
"; 25 | // echo $myObj->myOtherProperty; 26 | echo $myObj->myFunc(); 27 | 28 | $myChieldObj = new myChield; 29 | echo $myChieldObj->myChieldFunc(); 30 | 31 | ?> -------------------------------------------------------------------------------- /l25-con-des.php: -------------------------------------------------------------------------------- 1 | myPro; 12 | } 13 | public function __destruct() 14 | { 15 | echo "
Amar Ami"; 16 | } 17 | } 18 | $obj = new myClass; 19 | echo "
".$obj->myFunc(); 20 | ?> -------------------------------------------------------------------------------- /l26.oop-types.php: -------------------------------------------------------------------------------- 1 | myFunc(); 15 | ?> -------------------------------------------------------------------------------- /l27-static-oop.php: -------------------------------------------------------------------------------- 1 | myFunc(); 15 | ?> -------------------------------------------------------------------------------- /l28-const.oop.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l29-stop-con-obj-oop.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l3.const.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l30.abstract-oop.php: -------------------------------------------------------------------------------- 1 | name = $name; 9 | } 10 | 11 | abstract protected function myFunc() : string; 12 | } 13 | 14 | class myChiled extends myClass 15 | { 16 | public function myFunc(): string 17 | { 18 | return $this->name; 19 | } 20 | } 21 | 22 | $myChiled = new myChiled("Joy Bangla"); 23 | echo $myChiled->myFunc(); 24 | ?> -------------------------------------------------------------------------------- /l31.interface-oop.php: -------------------------------------------------------------------------------- 1 | name = $name; 14 | $this->age = $age; 15 | } 16 | 17 | public function personName () : string 18 | { 19 | return $this->name; 20 | } 21 | 22 | public function personAge () : int 23 | { 24 | return $this->age; 25 | } 26 | } 27 | 28 | class myChild extends myClass implements personInfo 29 | { 30 | public function personAge () : int 31 | { 32 | return $this->age; 33 | } 34 | 35 | public function personName(): string 36 | { 37 | return "Asif"; 38 | } 39 | } 40 | 41 | $myClass = new myClass("Tazul Vai", 42); 42 | echo "Person name is : ".$myClass->personName()." and person age is ".$myClass->personAge()."
"; 43 | 44 | $myChild = new myChild(age:420); 45 | echo $myChild->personAge()." ".$myChild->personName(); 46 | ?> -------------------------------------------------------------------------------- /l32-traits-oop.php: -------------------------------------------------------------------------------- 1 | title = $data; 28 | } 29 | 30 | public function myFunc3 (): string 31 | { 32 | $this->myPro = $this->myFunc1("Asif")." ".$this->myFunc2("Abir"); $this->myPro; 33 | return $this->title.": ".$this->myPro; 34 | } 35 | 36 | public abstract function myFunc4(): string; 37 | } 38 | 39 | class myChield extends myClass 40 | { 41 | public function myFunc4(): string 42 | { 43 | return $this->myFunc3(); 44 | } 45 | } 46 | 47 | $myChield = new myChield("Name"); 48 | echo $myChield->myFunc4(); 49 | ?> -------------------------------------------------------------------------------- /l33-sql-quries.php: -------------------------------------------------------------------------------- 1 | CREATE DATABASE `My Data` 2 | 3 | DROP DATABASE `My Data` 4 | 5 | CREATE TABLE `my table` ( 6 | `id` INT(11) NOT NULL AUTO_INCREMENT, 7 | `name` CHAR(100), 8 | `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 9 | PRIMARY KEY (`id`) 10 | ) 11 | 12 | INSERT INTO `my table`(`name`) VALUES ('Asif') 13 | 14 | INSERT INTO `my table`(`name`) VALUES ('Abir'), ('Mahamudunnobi'), ('Tazul'), ('Shakil') 15 | ALTER TABLE `my table` ADD `city` CHAR(100) AFTER `name` 16 | 17 | ALTER TABLE `my table` DROP`city` 18 | 19 | UPDATE `my table` SET `city` = 'Dhaka' WHERE `id` = 1 20 | 21 | DELETE FROM `my table` WHERE `id` = 5 22 | 23 | SELECT * FROM `my table` 24 | 25 | SELECT `name` FROM `my table` 26 | 27 | SELECT `name`, `city` FROM `my table` 28 | 29 | SELECT `my table`.`name`, `my table`.`city` FROM `my table` 30 | 31 | ALTER TABLE `my table` ADD FOREIGN KEY (`std_id`) REFERENCES `b76`.`students`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; 32 | 33 | SELECT `my table`.`name` AS 'Father' FROM `my table` 34 | 35 | SELECT `my data`.`my table`.`name` AS 'Father' FROM `my table` 36 | 37 | SELECT `my data`.`my table`.`name` AS 'Father', `my data`.`my table`.`city` AS 'Father City', `b76`.`students`.`name` AS 'Chield Name', `b76`.`students`.`gender` FROM `my data`.`my table` INNER JOIN `b76`.`students` ON `my data`.`my table`.`std_id` = `b76`.`students`.`id` 38 | 39 | SELECT * FROM `students` WHERE `name` = 'Kamal' AND `city` = 'Dhaka' 40 | 41 | SELECT * FROM `students` WHERE `name` = 'Kamal' OR `city` = 'Dhaka' 42 | 43 | SELECT * FROM `students` WHERE `name` LIKE '%ir' 44 | 45 | SELECT * FROM `students` WHERE `name` LIKE 'as%' 46 | 47 | SELECT * FROM `students` WHERE `name` LIKE '%khan%' 48 | 49 | SELECT * FROM `students` WHERE `name` LIKE '%mal%' OR `city` LIKE '%mal%' 50 | 51 | -------------------------------------------------------------------------------- /l34-connect-with-mysql.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM `students`") 6 | 7 | 8 | /* final class db { 9 | private static string $host = "localhost"; 10 | private static string $user = "root"; 11 | private static $pass = null; 12 | private static string $schema = "b76crud"; 13 | private static object $conn; 14 | 15 | private function __construct() 16 | { 17 | return; 18 | } 19 | 20 | public static function dbConn (): object 21 | { 22 | db::$conn = mysqli_connect(db::$host, db::$user, db::$pass, db::$schema); 23 | return db::$conn; 24 | } 25 | 26 | public static function getData ($q) : object 27 | { 28 | return db::dbConn()->query($q); 29 | } 30 | } 31 | $query = "SELECT * FROM `students`"; 32 | $allData = db::getData($query); */ 33 | ?> 34 | 35 | 36 | 37 | 38 | 39 | 40 | fetch_object()) { 42 | ?> 43 | 44 | 45 | 46 | 47 | 50 |
NameCity
name ?>city ?>
51 | -------------------------------------------------------------------------------- /l35-crud.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 10 | 11 | 12 | 13 | 21 | 26 | 27 | 28 | 29 | 30 | query("SELECT * FROM students ORDER BY `id` DESC"); 33 | $fileLink = basename($_SERVER['PHP_SELF']); 34 | 35 | if (!isset($_GET['update'])) { 36 | if ($students->num_rows > 5) { 37 | $_GET['limit'] ?? header("location: $fileLink?page=1&limit=5"); 38 | $limit = $_GET['limit']; 39 | $page = $_GET['page']; 40 | $total_page = ceil($students->num_rows / $limit); 41 | $start_point = ($page - 1) * $limit; 42 | $students = $conn->query("SELECT * FROM students ORDER BY `id` DESC LIMIT $start_point, $limit"); 43 | } 44 | } 45 | 46 | 47 | $genderList = ["Male", "Female"]; 48 | $cityList = ["Dhaka", "Rajshahi", "Chittagong", "Khulna", "Rongpur", "Bogura", "Barishal", "Others"]; 49 | 50 | if (isset($_POST['addStudent']) || isset($_POST['upStudent'])) { 51 | $sname = safuda($_POST['sname']); 52 | $gender = safuda($_POST['gender'] ?? null); 53 | $city = safuda($_POST['city']); 54 | 55 | if (empty($sname)) { 56 | $errName = "Please write your name"; 57 | } elseif (!preg_match("/^[A-Za-z. ]*$/", $sname)) { 58 | $errName = "Invalid name format"; 59 | } else { 60 | $crrSname = $conn->real_escape_string($sname); 61 | } 62 | 63 | if (empty($gender)) { 64 | $errGender = "Please select your gender"; 65 | } elseif (!in_array($gender, $genderList)) { 66 | $errGender = "Paknami bondho korun"; 67 | } else { 68 | $crrGender = $conn->real_escape_string($gender); 69 | } 70 | 71 | if (empty($city)) { 72 | $errCity = "Please select your city"; 73 | } elseif (!in_array($city, $cityList)) { 74 | $errCity = "Paknami bondho korun"; 75 | } else { 76 | $crrCity = $conn->real_escape_string($city); 77 | } 78 | 79 | if (isset($crrSname) && isset($crrGender) && isset($crrCity)) { 80 | if (isset($_POST['addStudent'])) { 81 | $insert_query = "INSERT INTO `students` (`name`, `gender`, `city`) VALUES ('$crrSname', '$crrGender', '$crrCity')"; 82 | $insert = $conn->query($insert_query); 83 | if (!$insert) { 84 | echo ''; 85 | } else { 86 | $cp = $_SERVER['PHP_SELF']; 87 | echo ""; 88 | } 89 | } 90 | 91 | if (isset($_POST['upStudent'])) { 92 | $updateID = $conn->real_escape_string($_POST['updateID']); 93 | $update_query = "UPDATE `students` SET `name` = '$crrSname', `gender` = '$crrGender', `city` = '$crrCity' WHERE `id` = $updateID"; 94 | $update = $conn->query($update_query); 95 | if (!$update) { 96 | echo ''; 97 | } else { 98 | $cp = $_SERVER['PHP_SELF']; 99 | echo ""; 100 | } 101 | } 102 | } 103 | } 104 | 105 | function safuda($data) 106 | { 107 | $data = htmlspecialchars($data); 108 | $data = trim($data); 109 | $data = stripslashes($data); 110 | return $data; 111 | } 112 | 113 | if (isset($_GET['update'])) { 114 | $updateID = safuda($_GET['update']); 115 | $get_update_data_query = "SELECT * FROM `students` WHERE `id` = $updateID"; 116 | $get_update_data = $conn->query($get_update_data_query); 117 | if ($get_update_data->num_rows != 1) { 118 | echo ""; 119 | } else { 120 | $update_data = $get_update_data->fetch_object(); 121 | $city = $update_data->city; 122 | } 123 | } 124 | 125 | if (isset($_POST['sdel'])) { 126 | $delId = safuda($_POST['delId']); 127 | $del_query = "DELETE FROM `students` WHERE `id` = $delId"; 128 | $del = $conn->query($del_query); 129 | if (!$del) { 130 | echo ''; 131 | } else { 132 | $cp = $_SERVER['PHP_SELF']; 133 | echo ""; 134 | } 135 | } 136 | ?> 137 |
138 |
139 | 140 | 141 |
142 |
143 |

Add Student

144 |
145 | " value=""> 146 |
147 |
148 |
149 |
150 | 151 |
152 |
153 | " name="gender" value="Male" > 154 | 155 |
156 |
157 | " name="gender" value="Female" > 158 | 159 |
160 | 161 |
162 |
163 |
164 | 172 |
173 | 174 |
175 |
176 | 177 | 178 |
179 |
180 |
181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | fetch_object()) { 192 | ?> 193 | 194 | 195 | 196 | 197 | 198 | 202 | 203 | 205 |
S.N.NameGenderCityAction
name ?>gender ?>city ?> 199 | Update 200 | 201 |
206 | 237 |
238 | 239 |
240 |
241 |
242 |

Update Student

243 | 244 |
245 | " value="name ?? null ?>"> 246 |
247 |
248 |
249 |
250 | 251 |
252 |
253 | " name="gender" value="Male" gender == "Male") ? "checked" : null; ?>> 254 | 255 |
256 |
257 | " name="gender" value="Female" gender == "Female") ? "checked" : null; ?>> 258 | 259 |
260 | 261 |
262 |
263 |
264 | 272 |
273 | 274 |
275 |
276 | 277 | 278 | 279 |
280 |
281 |
282 | 283 | 284 |
285 |
286 | 287 | 303 | 308 | 309 | 310 | 311 | -------------------------------------------------------------------------------- /l4.comment.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /l5-datatype.php: -------------------------------------------------------------------------------- 1 | "; 5 | 6 | $x = 123; 7 | var_dump($x); 8 | echo "
"; 9 | 10 | $x = 123.456; 11 | var_dump($x); 12 | echo "
"; 13 | 14 | $x = true; 15 | var_dump($x); 16 | echo "
"; 17 | 18 | $x = null; 19 | var_dump($x); 20 | echo "
"; 21 | 22 | $x = ["Shopno", "Podma", "Shetu"]; 23 | var_dump($x); 24 | echo "
"; 25 | 26 | class abul { 27 | public $babul = "Kabul"; 28 | } 29 | 30 | $x = new abul; 31 | var_dump($x); 32 | echo "
"; 33 | 34 | -------------------------------------------------------------------------------- /l6-operators.php: -------------------------------------------------------------------------------- 1 | 35 | * <= 36 | * >= 37 | * != 38 | * !== 39 | * <> 40 | */ 41 | 42 | /**Conditional operator 43 | * && 44 | * || 45 | * and 46 | * or 47 | * ! 48 | * xor 49 | */ -------------------------------------------------------------------------------- /l7-math.php: -------------------------------------------------------------------------------- 1 | "; 3 | echo min(5,10,110,3,312,56,-25)."
"; 4 | echo abs(-25)."
"; 5 | echo round(2.6)."
"; 6 | echo floor(2.9)."
"; 7 | echo ceil(2.1)."
"; 8 | echo sqrt(81)."
"; -------------------------------------------------------------------------------- /l8-string.php: -------------------------------------------------------------------------------- 1 | "; 4 | echo str_word_count($x)."
"; 5 | echo strrev($x)."
"; 6 | echo strpos($x, "valo")."
"; 7 | echo str_replace("achi", "nai", $x)."
"; 8 | echo substr($x, 0, 8)."..."."
"; -------------------------------------------------------------------------------- /l9-condition.php: -------------------------------------------------------------------------------- 1 | 0){ 5 | echo "You are a baby"; 6 | }elseif($age < 20 && $age >= 13){ 7 | echo "You are a teeanger"; 8 | }elseif($age < 30 && $age >= 20){ 9 | echo "You are a a young person"; 10 | }elseif($age < 50 && $age >= 30){ 11 | echo "You are a middle age person"; 12 | }elseif($age >= 50 && $age < 150){ 13 | echo "You are an old person"; 14 | }else{ 15 | echo "Sorry! you are not in this world!"; 16 | } 17 | 18 | echo "
"; 19 | 20 | // $city = "Kolkata"; 21 | 22 | switch ($age) { 23 | case ($age < 13 && $age > 0): 24 | echo "Dhaka ekhon faka"; 25 | break; 26 | case ($age < 20 && $age >= 13): 27 | echo "Dhaka ekhon faka"; 28 | break; 29 | case ($age < 30 && $age >= 20): 30 | echo "Dhaka ekhon faka"; 31 | break; 32 | case ($age < 50 && $age >= 30): 33 | echo "Dhaka ekhon faka"; 34 | break; 35 | case ($age >= 50 && $age < 150): 36 | echo "Dhaka ekhon faka"; 37 | break; 38 | 39 | default: 40 | echo "Podda shetu diye ghure ashlam!"; 41 | break; 42 | } 43 | 44 | echo "
"; 45 | 46 | $x = 10; 47 | 48 | // if($x < 12){ 49 | // echo "halum"; 50 | // }else{ 51 | // echo "ha ha"; 52 | // } 53 | echo ($x < 8)? "halum":"ha ha"; 54 | 55 | echo "
"; 56 | // if(isset($x)){ 57 | // echo $x; 58 | // }else{ 59 | // echo 8; 60 | // } 61 | // echo (isset($x))? $x:8; 62 | 63 | echo $y ?? null; 64 | ?> -------------------------------------------------------------------------------- /problem.js: -------------------------------------------------------------------------------- 1 | var n = prompt(); 2 | if (n % 2 == 0 && n != 2) { 3 | console.log("Yes"); 4 | } else { 5 | console.log("No"); 6 | } 7 | -------------------------------------------------------------------------------- /problem.php: -------------------------------------------------------------------------------- 1 | 2){ 4 | echo "YES"; 5 | }else{ 6 | echo "NO"; 7 | } 8 | ?> -------------------------------------------------------------------------------- /simplecrud/add.php: -------------------------------------------------------------------------------- 1 | 5 | 6 |
7 | 8 | 9 | 10 |
11 | 12 | real_escape_string($_POST['sname'])); 23 | $scity = safuda($conn->real_escape_string($_POST['scity'])); 24 | if (!empty($sname) && !empty($scity)) { 25 | $insert = $conn->query("INSERT INTO `students` (`name`, `city`) VALUES ('$sname', '$scity')"); 26 | if ($insert) { 27 | header("location: index.php"); 28 | } 29 | } 30 | } 31 | 32 | ?> -------------------------------------------------------------------------------- /simplecrud/del.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM `students` WHERE `id` = $id"); 8 | if ($check->num_rows == 0) { 9 | header("location: index.php"); 10 | } else { 11 | ?> 12 |

Do you realy want to delete student?

13 | 14 |
15 | 16 |
17 | query("DELETE FROM `students` WHERE `id` = $id"); 23 | if ($del) { 24 | echo ""; 25 | } else { 26 | echo ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /simplecrud/index.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | query("SELECT * FROM `students`"); 9 | if ($select->num_rows > 0) { 10 | echo ""; 15 | } 16 | ?> -------------------------------------------------------------------------------- /simplecrud/up.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM `students` WHERE `id` = $id"); 8 | if ($check->num_rows == 0) { 9 | header("location: index.php"); 10 | } else { 11 | $preData = $check->fetch_object(); 12 | } 13 | } 14 | 15 | function safuda($data) 16 | { 17 | $data = htmlspecialchars($data); 18 | $data = trim($data); 19 | $data = stripslashes($data); 20 | return $data; 21 | } 22 | if (isset($_POST['up123'])) { 23 | $sname = safuda($conn->real_escape_string($_POST['sname'])); 24 | $scity = safuda($conn->real_escape_string($_POST['scity'])); 25 | if (!empty($sname) && !empty($scity)) { 26 | $update = $conn->query("UPDATE `students` SET `name` = '$sname', `city` = '$scity' WHERE `id` = $id"); 27 | if ($update) { 28 | echo ""; 29 | } else { 30 | echo ""; 31 | } 32 | } 33 | } 34 | ?> 35 |

Update Student Data

36 |
37 | 38 | 39 | 40 |
--------------------------------------------------------------------------------