├── List of PHP projects.docx ├── List of PHP projects.pdf ├── List of PHP projects.txt └── PHP_KUIZ ├── .github └── FUNDING.yml ├── DB └── php-kuiz.sql ├── README.md ├── add.php ├── admin.php ├── adminhome.php ├── allquestions.php ├── connection.php ├── css ├── style.css └── style1.css ├── editquestion.php ├── exit.php ├── home.php ├── index.php ├── login_details.txt ├── players.php ├── process.php ├── question.php └── results.php /List of PHP projects.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeWithEdison/150-PHP-project-for-college/a99a7828948d886163ede5acd11dffccfc60473b/List of PHP projects.docx -------------------------------------------------------------------------------- /List of PHP projects.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeWithEdison/150-PHP-project-for-college/a99a7828948d886163ede5acd11dffccfc60473b/List of PHP projects.pdf -------------------------------------------------------------------------------- /List of PHP projects.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeWithEdison/150-PHP-project-for-college/a99a7828948d886163ede5acd11dffccfc60473b/List of PHP projects.txt -------------------------------------------------------------------------------- /PHP_KUIZ/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: ['https://www.anirbandutta.in/pay', 'https://www.paypal.com/paypalme2/hianirban', 'https://www.anirbandutta.in/upi.jpeg'] 4 | -------------------------------------------------------------------------------- /PHP_KUIZ/DB/php-kuiz.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.6.4 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Host: 127.0.0.1 6 | -- Generation Time: Jul 31, 2017 at 07:27 AM 7 | -- Server version: 5.7.14 8 | -- PHP Version: 5.6.25 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET time_zone = "+00:00"; 12 | 13 | 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 | /*!40101 SET NAMES utf8mb4 */; 18 | 19 | -- 20 | -- Database: `php-kuiz` 21 | -- 22 | 23 | -- -------------------------------------------------------- 24 | 25 | -- 26 | -- Table structure for table `questions` 27 | -- 28 | 29 | CREATE TABLE `questions` ( 30 | `qid` int(11) NOT NULL, 31 | `qno` int(11) NOT NULL, 32 | `question` text NOT NULL, 33 | `ans1` text NOT NULL, 34 | `ans2` text NOT NULL, 35 | `ans3` text NOT NULL, 36 | `ans4` text NOT NULL, 37 | `correct_answer` varchar(1) NOT NULL 38 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 39 | 40 | -- 41 | -- Dumping data for table `questions` 42 | -- 43 | 44 | INSERT INTO `questions` (`qid`, `qno`, `question`, `ans1`, `ans2`, `ans3`, `ans4`, `correct_answer`) VALUES 45 | (9, 5, 'What is a correct way to add a comment in PHP?', '<!--…-->', '/*…*/', '*\\..\\*', '<comment>…</comment>', 'b'), 46 | (8, 3, 'The PHP syntax is most similar to:', 'Perl and C', 'VBscript', 'Javascript', 'none of these', 'a'), 47 | (7, 2, 'How do you write "Hello World" in PHP?', 'echo "Hello World";', 'Document.Write("Hello World");', '"Hello World";', 'none of these', 'a'), 48 | (6, 1, 'What does PHP stand for?', 'Personal Hypertext Processor\r\n', 'Private Home Page', 'Personal Home Page', 'PHP: Hypertext Preprocessor', 'd'), 49 | (5, 4, 'How do you get information from a form that is submitted using the "get" method?', '$_GET[];', 'Request.Form;', 'Request.QueryString;', 'none of these', 'a'), 50 | (10, 6, 'When using the POST method, variables are displayed in the URL:', 'True', 'False', 'Can\'t say', 'none of these', 'b'), 51 | (11, 7, ' Which of the following function is used to get the size of a file?', 'fopen()', 'fread()', 'fsize()', 'filesize()', 'd'), 52 | (12, 8, 'Which of the following is used to delete a cookie?', 'setcookie()', '$_COOKIE variable', 'isset() function', 'none of the above', 'a'); 53 | 54 | -- -------------------------------------------------------- 55 | 56 | -- 57 | -- Table structure for table `users` 58 | -- 59 | 60 | CREATE TABLE `users` ( 61 | `id` int(11) NOT NULL, 62 | `email` varchar(225) NOT NULL, 63 | `played_on` varchar(225) NOT NULL, 64 | `score` int(11) NOT NULL DEFAULT '0' 65 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 66 | 67 | -- 68 | -- Dumping data for table `users` 69 | -- 70 | 71 | INSERT INTO `users` (`id`, `email`, `played_on`, `score`) VALUES 72 | (78, 'hemant@vv.com', '2017-07-31 06:52:45', 0), 73 | (68, 'admin@gmail.com', '2017-07-31 05:01:43', 0), 74 | (77, 'root@gmail.com', '2017-07-31 06:52:09', 1), 75 | (70, 'anirban@gmail.com', '2017-07-31 05:58:32', 3), 76 | (76, 'john@gmail.com', '2017-07-31 06:51:41', 1), 77 | (72, 'local@gmail.com', '2017-07-31 06:01:27', 3), 78 | (75, 'dfgh@fgg.nn', '2017-07-31 06:43:01', 0), 79 | (74, 'vishal@gmail.com', '2017-07-31 06:35:35', 6), 80 | (79, 'rupesh@dffd.cvvc', '2017-07-31 06:53:37', 5), 81 | (80, 'hello@gmail.com', '2017-07-31 06:58:18', 5); 82 | 83 | -- 84 | -- Indexes for dumped tables 85 | -- 86 | 87 | -- 88 | -- Indexes for table `questions` 89 | -- 90 | ALTER TABLE `questions` 91 | ADD PRIMARY KEY (`qid`); 92 | 93 | -- 94 | -- Indexes for table `users` 95 | -- 96 | ALTER TABLE `users` 97 | ADD PRIMARY KEY (`id`); 98 | 99 | -- 100 | -- AUTO_INCREMENT for dumped tables 101 | -- 102 | 103 | -- 104 | -- AUTO_INCREMENT for table `questions` 105 | -- 106 | ALTER TABLE `questions` 107 | MODIFY `qid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; 108 | -- 109 | -- AUTO_INCREMENT for table `users` 110 | -- 111 | ALTER TABLE `users` 112 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=81; 113 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 114 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 115 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 116 | -------------------------------------------------------------------------------- /PHP_KUIZ/README.md: -------------------------------------------------------------------------------- 1 | # PHP Kuiz 2 | ## Simple web based quiz application written in php and mysqli. This application can be used to test the knowledge of the player 3 | 4 | 5 | 6 | PHP Kuiz Home Page -> 7 | 8 | ![q1](https://user-images.githubusercontent.com/16975766/28767646-1e855290-75f2-11e7-98c5-9d73128d2fed.png) 9 | 10 | 11 | PHP Kuiz Admin Panel -> 12 | 13 | ![q2](https://user-images.githubusercontent.com/16975766/28767662-2f175ee6-75f2-11e7-99ce-d75edc39784f.png) 14 | 15 | 16 | ### Full Demo 17 | [PHP Kuiz](https://www.youtube.com/watch?v=TwSz9bBSpbI) 18 | 19 | ### Requirements 20 | 21 | - PHP 5.3 or higher recommended 22 | - MySQL DB 23 | 24 | ### Tools Used 25 | Front-end : HTML, CSS 26 | Back-end: PHP, MySqli 27 | 28 | ### Installation 29 | - Upload PHP-Kuiz to the directory of your choice. 30 | - Import MySql Db file to your database software (E.g : Php_My_Admin ) 31 | - Configure connection to your database and server by modifying connection.php file 32 | - Navigate to the installation in your browser 33 | - Done :) 34 | 35 | ### Login Details 36 | 37 | 1. Admin Panel: 38 | 39 | password: adminpass123 40 | 41 | 42 | ### Main Features 43 | 44 | - Easy play: Only requires an email to start playing 45 | - Functional Admin panel: Allows admins to manage the whole system 46 | - Add/Edit questions according to need 47 | - View player details ( Eg: score,email etc ..) 48 | - Set timer for each question 49 | 50 | ### To-Do list 51 | - Add level for playing from hard to easy with different questions 52 | 53 | ### Issues 54 | 55 | Please log any issues found in the repository 56 | 57 | ### License 58 | PHP Kuiz is released under the MIT License 59 | developed by https://codewithedison.github.io/codeWithEdison-portifolio/ 60 | -------------------------------------------------------------------------------- /PHP_KUIZ/add.php: -------------------------------------------------------------------------------- 1 | 2 | 0 ) { 21 | echo " " ; 22 | } 23 | else { 24 | " " ; 25 | } 26 | } 27 | 28 | ?> 29 | 30 | 31 | 32 | 33 | 34 | PHP-Kuiz 35 | 36 | 37 | 38 | 39 |
40 |
41 |

PHP-Kuiz

42 | Home 43 | Add Question 44 | All Questions 45 | Players 46 | Logout 47 | 48 |
49 |
50 | 51 |
52 |
53 |

Add a question...

54 |
55 | 56 |

57 | 58 | 59 |

60 |

61 | 62 | 63 |

64 |

65 | 66 | 67 |

68 |

69 | 70 | 71 |

72 |

73 | 74 | 75 |

76 |

77 | 78 | 84 |

85 |

86 | 87 | 88 |

89 |
90 |
91 |
92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /PHP_KUIZ/admin.php: -------------------------------------------------------------------------------- 1 | alert('wrong password');"; 16 | } 17 | } 18 | 19 | 20 | ?> 21 | 22 | 23 | 24 | 25 | 26 | PHP-kuiz 27 | 28 | 29 | 30 | 31 |
32 |
33 |

PHP-kuiz

34 | Home 35 | 36 |
37 |
38 | 39 |
40 |
41 |

Enter Password

42 |
43 | 44 | 45 | 46 |
47 | 48 | 49 |
50 | 51 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /PHP_KUIZ/adminhome.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | PHP-Kuiz 13 | 14 | 15 | 16 | 17 |
18 |
19 |

PHP-kuiz

20 | Home 21 | Add Question 22 | All Questions 23 | Players 24 | Logout 25 | 26 |
27 |
28 | 29 |
30 |
31 |

Welcome back, Admin

32 |
33 |
34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /PHP_KUIZ/allquestions.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | PHP-Kuiz 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

PHP-Kuiz

18 | Home 19 | Add Question 20 | All Questions 21 | Players 22 | Logout 23 | 24 |
25 |
26 | 27 | 28 |

All Questions

29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 0 ) { 50 | while ($row = mysqli_fetch_array($select_questions)) { 51 | $qno = $row['qno']; 52 | $question = $row['question']; 53 | $option1 = $row['ans1']; 54 | $option2 = $row['ans2']; 55 | $option3 = $row['ans3']; 56 | $option4 = $row['ans4']; 57 | $Answer = $row['correct_answer']; 58 | echo ""; 59 | echo ""; 60 | echo ""; 61 | echo ""; 62 | echo ""; 63 | echo ""; 64 | echo ""; 65 | echo ""; 66 | echo ""; 67 | 68 | echo ""; 69 | } 70 | } 71 | ?> 72 | 73 | 74 | 75 |
All kuiz questions
Q.NOQuestionOption1Option2Option3Option4Correct Answer Edit
$qno$question$option1$option2$option3$option4$Answer Edit
76 | 77 | 78 | 79 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /PHP_KUIZ/connection.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /PHP_KUIZ/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: arial; 3 | font-size: 15px; 4 | line-height: 1.6em; 5 | } 6 | 7 | li{ 8 | list-style: none; 9 | } 10 | 11 | a{ 12 | text-decoration: none; 13 | } 14 | 15 | label{ 16 | display: inline-block; 17 | width: 180px; 18 | } 19 | 20 | input[type='text']{ 21 | width: 97%; 22 | padding: 4px; 23 | border-radius: 5px; 24 | border:1px #ccc solid; 25 | } 26 | 27 | input[type='number']{ 28 | width: 50px; 29 | padding: 4px; 30 | border-radius: 5px; 31 | border:1px #ccc solid; 32 | } 33 | 34 | .container{ 35 | width: 60%; 36 | margin: 0 auto; 37 | overflow: auto; 38 | } 39 | 40 | header{ 41 | border-bottom: 3px #272726 solid; 42 | background: #3A3A36; 43 | color: white; 44 | } 45 | 46 | a.add { 47 | display: inline-block; 48 | color: #666; 49 | background: #f4f4f4; 50 | border-left: 7px #272726 solid; 51 | padding:6px 13px; 52 | position: right; 53 | } 54 | 55 | footer{ 56 | border-top: 3px #272726 solid; 57 | background: #3A3A36; 58 | color: #BBBBB9; 59 | text-align: center; 60 | padding-top: 5px; 61 | padding-bottom: 5px; 62 | } 63 | 64 | main{ 65 | padding-bottom: 20px; 66 | background: #61615E; 67 | color: white; 68 | } 69 | 70 | 71 | a.start{ 72 | display: inline-block; 73 | color: #000000; 74 | background: #99CC00; 75 | border-left: 7px #272726 solid; 76 | padding:6px 13px; 77 | } 78 | 79 | .current{ 80 | padding:10px; 81 | background: #8D8D8B; 82 | border-left: 10px #272726 solid; 83 | margin: 20px 0 10px 0; 84 | } 85 | 86 | @media only screen and (max-width: 960px){ 87 | .container{ 88 | width: 60%; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /PHP_KUIZ/css/style1.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 15px; 3 | color: #343d44; 4 | font-family: "segoe-ui", "open-sans", tahoma, arial; 5 | padding: 0; 6 | margin: 0; 7 | } 8 | table { 9 | margin: auto; 10 | font-family: "Lucida Sans Unicode", "Lucida Grande", "Segoe Ui"; 11 | font-size: 12px; 12 | } 13 | 14 | h1 { 15 | margin: 25px auto 0; 16 | text-align: center; 17 | text-transform: uppercase; 18 | font-size: 17px; 19 | } 20 | 21 | table td { 22 | transition: all .5s; 23 | } 24 | 25 | /* Table */ 26 | .data-table { 27 | border-collapse: collapse; 28 | font-size: 14px; 29 | min-width: 537px; 30 | } 31 | 32 | .data-table th, 33 | .data-table td { 34 | border: 1px solid #e1edff; 35 | padding: 7px 17px; 36 | } 37 | .data-table caption { 38 | margin: 7px; 39 | } 40 | 41 | /* Table Header */ 42 | .data-table thead th { 43 | background-color: #508abb; 44 | color: #FFFFFF; 45 | border-color: #6ea1cc !important; 46 | text-transform: uppercase; 47 | 48 | } 49 | 50 | /* Table Body */ 51 | .data-table tbody td { 52 | color: #353535; 53 | } 54 | .data-table tbody td:first-child, 55 | .data-table tbody td:nth-child(4), 56 | .data-table tbody td:last-child { 57 | text-align: right; 58 | } 59 | 60 | .data-table tbody tr:nth-child(odd) td { 61 | background-color: #f4fbff; 62 | } 63 | .data-table tbody tr:hover td { 64 | background-color: #ffffa2; 65 | border-color: #ffff0f; 66 | } 67 | 68 | /* Table Footer */ 69 | .data-table tfoot th { 70 | background-color: #e5f5ff; 71 | text-align: right; 72 | } 73 | .data-table tfoot th:first-child { 74 | text-align: left; 75 | } 76 | .data-table tbody td:empty 77 | { 78 | background-color: #ffcccc; 79 | } -------------------------------------------------------------------------------- /PHP_KUIZ/editquestion.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 0) { 15 | while ($row = mysqli_fetch_array($run)) { 16 | $qno = $row['qno']; 17 | $question = $row['question']; 18 | $ans1 = $row['ans1']; 19 | $ans2 = $row['ans2']; 20 | $ans3 = $row['ans3']; 21 | $ans4 = $row['ans4']; 22 | $correct_answer = $row['correct_answer']; 23 | } 24 | } 25 | else { 26 | echo "" ; 28 | } 29 | } 30 | else { 31 | header("location: allquestions.php"); 32 | } 33 | } 34 | 35 | ?> 36 | 0 ) { 49 | echo " " ; 51 | } 52 | else { 53 | " " ; 54 | } 55 | } 56 | 57 | ?> 58 | 59 | 60 | 61 | 62 | 63 | PHP-Kuiz 64 | 65 | 66 | 67 | 68 |
69 |
70 |

PHP-Kuiz

71 | Home 72 | Add Question 73 | All Questions 74 | Logout 75 | 76 |
77 |
78 | 79 |
80 |
81 |

Add a question...

82 | 83 | 84 |

85 | 86 | 87 |

88 |

89 | 90 | 91 |

92 |

93 | 94 | 95 |

96 |

97 | 98 | 99 |

100 |

101 | 102 | 103 |

104 |

105 | 106 | 112 |

113 |

114 | 115 | 116 |

117 | 118 |
119 |
120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /PHP_KUIZ/exit.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PHP_KUIZ/home.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | PHP-kuiz 13 | 14 | 15 | 16 | 17 |
18 |
19 |

PHP-Kuiz

20 |
21 |
22 | 23 |
24 |
25 |

Welcome to PHP Kuiz !

26 |

This is just a simple quiz game to test your knowledge!

27 | 33 | Start Kuiz 34 | Exit 35 | 36 |
37 |
38 | 39 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /PHP_KUIZ/index.php: -------------------------------------------------------------------------------- 1 | 5 | 10 | 0) { 17 | $played_on = date('Y-m-d H:i:s'); 18 | $update = "UPDATE users SET played_on = '$played_on' WHERE email = '$email' "; 19 | $runupdate = mysqli_query($conn , $update) or die(mysqli_error($conn)); 20 | $row = mysqli_fetch_array($runcheck); 21 | $id = $row['id']; 22 | $_SESSION['id'] = $id; 23 | $_SESSION['email'] = $row['email']; 24 | header("location: home.php"); 25 | } 26 | else { 27 | $played_on = date('Y-m-d H:i:s'); 28 | $query = "INSERT INTO users(email,played_on) VALUES ('$email','$played_on')"; 29 | $run = mysqli_query($conn, $query) or die(mysqli_error($conn)) ; 30 | if (mysqli_affected_rows($conn) > 0) { 31 | $query2 = "SELECT * FROM users WHERE email = '$email' "; 32 | $run2 = mysqli_query($conn , $query2) or die(mysqli_error($conn)); 33 | if (mysqli_num_rows($run2) > 0) { 34 | $row = mysqli_fetch_array($run2); 35 | $id = $row['id']; 36 | $_SESSION['id'] = $id; 37 | $_SESSION['email'] = $row['email']; 38 | header("location: home.php"); 39 | } 40 | } 41 | else { 42 | echo ""; 43 | } 44 | } 45 | } 46 | else { 47 | echo ""; 48 | } 49 | } 50 | 51 | 52 | 53 | ?> 54 | 55 | 56 | PHP-kuiz 57 | 58 | 59 | 60 | 61 |
62 |
63 |

PHP-kuiz

64 | Home 65 | Admin Panel 66 | 67 |
68 |
69 | 70 |
71 |
72 |

Enter Your Email

73 |
74 | 75 | 76 | 77 |
78 | 79 | 80 |
81 | 82 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /PHP_KUIZ/login_details.txt: -------------------------------------------------------------------------------- 1 | 2 | admin panel password : adminpass123 3 | 4 | -------------------------------------------------------------------------------- /PHP_KUIZ/players.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | PHP-Kuiz 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

PHP-Kuiz

17 | Home 18 | Add Question 19 | All Questions 20 | Players 21 | Logout 22 | 23 |
24 |
25 | 26 | 27 |

All Players

28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 0 ) { 44 | while ($row = mysqli_fetch_array($select_players)) { 45 | $id = $row['id']; 46 | $email = $row['email']; 47 | $played_on = $row['played_on']; 48 | $score = $row['score']; 49 | echo ""; 50 | echo ""; 51 | echo ""; 52 | echo ""; 53 | echo ""; 54 | 55 | echo ""; 56 | } 57 | } 58 | ?> 59 | 60 | 61 | 62 |
All kuiz players
Player IdEmailPlayed OnScore
$id$email$played_on$score
63 | 64 | 65 | 66 | 71 | 72 | -------------------------------------------------------------------------------- /PHP_KUIZ/process.php: -------------------------------------------------------------------------------- 1 | $_SESSION['time_up']) { 13 | echo ""; 15 | } 16 | else { 17 | $_SESSION['start_time'] = $newtime; 18 | $qno = $_POST['number']; 19 | $_SESSION['quiz'] = $_SESSION['quiz'] + 1; 20 | $selected_choice = $_POST['choice']; 21 | $nextqno = $qno+1; 22 | 23 | $query = "SELECT correct_answer FROM questions WHERE qno= '$qno' "; 24 | $run = mysqli_query($conn , $query) or die(mysqli_error($conn)); 25 | if(mysqli_num_rows($run) > 0 ) { 26 | $row = mysqli_fetch_array($run); 27 | $correct_answer = $row['correct_answer']; 28 | } 29 | if ($correct_answer == $selected_choice) { 30 | $_SESSION['score']++; 31 | } 32 | 33 | $query1 = "SELECT * FROM questions "; 34 | $run = mysqli_query($conn , $query1) or die(mysqli_error($conn)); 35 | $totalqn = mysqli_num_rows($run); 36 | 37 | if ($qno == $totalqn) { 38 | header("location: results.php"); 39 | } 40 | else { 41 | header("location: question.php?n=".$nextqno); 42 | } 43 | 44 | 45 | } 46 | } 47 | else { 48 | header("location: home.php"); 49 | } 50 | } 51 | else { 52 | header("location: home.php"); 53 | } 54 | ?> -------------------------------------------------------------------------------- /PHP_KUIZ/question.php: -------------------------------------------------------------------------------- 1 | 0) { 19 | $row = mysqli_fetch_array($run); 20 | $qno = $row['qno']; 21 | $question = $row['question']; 22 | $ans1 = $row['ans1']; 23 | $ans2 = $row['ans2']; 24 | $ans3 = $row['ans3']; 25 | $ans4 = $row['ans4']; 26 | $correct_answer = $row['correct_answer']; 27 | $_SESSION['quiz'] = $qno; 28 | $checkqsn = "SELECT * FROM questions" ; 29 | $runcheck = mysqli_query($conn , $checkqsn) or die(mysqli_error($conn)); 30 | $countqsn = mysqli_num_rows($runcheck); 31 | $time = time(); 32 | $_SESSION['start_time'] = $time; 33 | $allowed_time = $countqsn * 0.05; 34 | $_SESSION['time_up'] = $_SESSION['start_time'] + ($allowed_time * 60) ; 35 | 36 | 37 | } 38 | else { 39 | echo " " ; 41 | } 42 | } 43 | else { 44 | echo " " ; 46 | } 47 | ?> 48 | 54 | 55 | 56 | PHP-kuiz 57 | 58 | 59 | 60 | 61 |
62 |
63 |

PHP-Kuiz

64 |
65 |
66 | 67 |
68 |
69 |
Question of
70 |

71 | 72 | 79 | 80 | 81 |
82 |
83 | Stop Kqiz 84 | 85 |
86 |
87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /PHP_KUIZ/results.php: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | 12 | PHP-kuiz 13 | 14 | 15 | 16 | 17 |
18 |
19 |

PHP-Kuiz

20 |
21 |
22 | 23 |
24 |
25 |

Congratulations!

26 |

You have successfully completed the test

27 |

Total points:

30 | Start Again 31 | Go Home 32 |
33 |
34 | 35 | 36 | 37 | 43 | 44 | 45 | 46 | 47 | 48 | 53 | 54 | --------------------------------------------------------------------------------