├── img ├── b1.jpg ├── b2.jpg ├── b3.jpg ├── car.jpg ├── jcb.jpg ├── bike.jpg ├── buggy.jpg ├── doll.jpg ├── drone.jpg ├── lamba.jpg ├── phone.jpg ├── robo.jpg ├── rover.jpg ├── teddy.jpg ├── truck.jpg ├── babytoy.jpg ├── cycyle.jpg ├── dinosers.jpg ├── elephant.jpg ├── monster.jpg ├── tractor.jpg ├── blank-avatar.jpg ├── favicon-16x16.png ├── screenshot-1.png ├── screenshot-2.png ├── screenshot-3.png ├── screenshot-4.png ├── screenshot-5.png ├── screenshot-6.png ├── localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_40_05 PM.png ├── localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_41_13 PM.png └── localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_41_20 PM.png ├── logout.php ├── css └── main.css ├── config.php ├── js └── script.js ├── README.md ├── registered.sql ├── womens.html ├── mens.html ├── login.php ├── index.php └── register.php /img/b1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/b1.jpg -------------------------------------------------------------------------------- /img/b2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/b2.jpg -------------------------------------------------------------------------------- /img/b3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/b3.jpg -------------------------------------------------------------------------------- /img/car.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/car.jpg -------------------------------------------------------------------------------- /img/jcb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/jcb.jpg -------------------------------------------------------------------------------- /img/bike.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/bike.jpg -------------------------------------------------------------------------------- /img/buggy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/buggy.jpg -------------------------------------------------------------------------------- /img/doll.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/doll.jpg -------------------------------------------------------------------------------- /img/drone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/drone.jpg -------------------------------------------------------------------------------- /img/lamba.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/lamba.jpg -------------------------------------------------------------------------------- /img/phone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/phone.jpg -------------------------------------------------------------------------------- /img/robo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/robo.jpg -------------------------------------------------------------------------------- /img/rover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/rover.jpg -------------------------------------------------------------------------------- /img/teddy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/teddy.jpg -------------------------------------------------------------------------------- /img/truck.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/truck.jpg -------------------------------------------------------------------------------- /img/babytoy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/babytoy.jpg -------------------------------------------------------------------------------- /img/cycyle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/cycyle.jpg -------------------------------------------------------------------------------- /img/dinosers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/dinosers.jpg -------------------------------------------------------------------------------- /img/elephant.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/elephant.jpg -------------------------------------------------------------------------------- /img/monster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/monster.jpg -------------------------------------------------------------------------------- /img/tractor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/tractor.jpg -------------------------------------------------------------------------------- /img/blank-avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/blank-avatar.jpg -------------------------------------------------------------------------------- /img/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/favicon-16x16.png -------------------------------------------------------------------------------- /img/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/screenshot-1.png -------------------------------------------------------------------------------- /img/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/screenshot-2.png -------------------------------------------------------------------------------- /img/screenshot-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/screenshot-3.png -------------------------------------------------------------------------------- /img/screenshot-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/screenshot-4.png -------------------------------------------------------------------------------- /img/screenshot-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/screenshot-5.png -------------------------------------------------------------------------------- /img/screenshot-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/screenshot-6.png -------------------------------------------------------------------------------- /img/localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_40_05 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_40_05 PM.png -------------------------------------------------------------------------------- /img/localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_41_13 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_41_13 PM.png -------------------------------------------------------------------------------- /img/localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_41_20 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Muthukumarshub/Toys_store_with-data_base/HEAD/img/localhost_Nithin_index.php and 2 more pages - Personal 2 - Microsoft​ Edge Beta 5_15_2024 6_41_20 PM.png -------------------------------------------------------------------------------- /logout.php: -------------------------------------------------------------------------------- 1 | " . "window.location.href='./login.php';" . ""; 13 | exit; 14 | -------------------------------------------------------------------------------- /css/main.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@400;500;600;700&display=swap"); 2 | 3 | body { 4 | font-family: "Barlow Semi Condensed", sans-serif; 5 | } 6 | 7 | .alert { 8 | padding: 0.5rem; 9 | } 10 | 11 | .form-wrap h1, 12 | .form-wrap .form-label { 13 | font-weight: 600; 14 | } 15 | -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Men's Wear 7 | 129 | 130 | 131 |
132 | Home 133 | Kids 134 | Adults 135 | 136 | 137 | 138 |
139 |

Adults collections

140 |
141 |
142 | Item 1 143 |

Buggy

144 |

Price: $9

145 |

Discount: 10%

146 | 147 | 148 |
149 |
150 | Item 1 151 |

Car

152 |

Price: $10

153 |

Discount: 11%

154 | 155 | 156 |
157 |
158 | Item 1 159 |

Drone

160 |

Price: $13

161 |

Discount: 10%

162 | 163 | 164 |
165 |
166 | Item 1 167 |

JCB

168 |

Price: $10

169 |

Discount: 9%

170 | 171 | 172 |
173 |
174 | Item 1 175 |

Tractor

176 |

Price: $13

177 |

Discount: 13%

178 | 179 | 180 |
181 |
182 | Item 1 183 |

Bike

184 |

Price: $16

185 |

Discount: 40%

186 | 187 | 188 |
189 |
190 | Item 1 191 |

Teddy bear

192 |

Price: $17

193 |

Discount: 30%

194 | 195 | 196 |
197 |
198 | Item 2 199 |

Toy cycle

200 |

Price: $14

201 |

Discount: 20%

202 | 203 |
204 |
205 | Item 3 206 |

Truck

207 |

Price: $8

208 |

Discount: 15%

209 | 210 | 211 |
212 |
213 | 214 | 215 | -------------------------------------------------------------------------------- /mens.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Men's Wear 7 | 127 | 128 | 129 |
130 | Home 131 | Kids 132 | Adults 133 | 134 | 135 | 136 |
137 |

Kids collections

138 |
139 |
140 | Item 1 141 |

Baby makeup set

142 |

Price: $9

143 |

Discount: 10%

144 | 145 | 146 |
147 |
148 | Item 1 149 |

Baby doll

150 |

Price: $10

151 |

Discount: 11%

152 | 153 | 154 |
155 |
156 | Item 1 157 |

Dino

158 |

Price: $13

159 |

Discount: 10%

160 | 161 | 162 |
163 |
164 | Item 1 165 |

Toy Cycle

166 |

Price: $10

167 |

Discount: 9%

168 | 169 | 170 |
171 |
172 | Item 1 173 |

Elephant

174 |

Price: $13

175 |

Discount: 13%

176 | 177 | 178 |
179 |
180 | Item 1 181 |

Toy phone

182 |

Price: $16

183 |

Discount: 40%

184 | 185 | 186 |
187 |
188 | Item 1 189 |

Teddy bear

190 |

Price: $17

191 |

Discount: 30%

192 | 193 | 194 |
195 |
196 | Item 2 197 |

Toy cycle

198 |

Price: $14

199 |

Discount: 20%

200 | 201 |
202 |
203 | Item 3 204 |

Bike toy

205 |

Price: $8

206 |

Discount: 15%

207 | 208 | 209 |
210 |
211 | 212 | 213 | -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | " . "window.location.href='./'" . ""; 8 | exit; 9 | } 10 | 11 | # Include connection 12 | require_once "./config.php"; 13 | 14 | # Define variables and initialize with empty values 15 | $user_login_err = $user_password_err = $login_err = ""; 16 | $user_login = $user_password = ""; 17 | 18 | # Processing form data when form is submitted 19 | if ($_SERVER["REQUEST_METHOD"] == "POST") { 20 | if (empty(trim($_POST["user_login"]))) { 21 | $user_login_err = "Please enter your username or an email id."; 22 | } else { 23 | $user_login = trim($_POST["user_login"]); 24 | } 25 | 26 | if (empty(trim($_POST["user_password"]))) { 27 | $user_password_err = "Please enter your password."; 28 | } else { 29 | $user_password = trim($_POST["user_password"]); 30 | } 31 | 32 | # Validate credentials 33 | if (empty($user_login_err) && empty($user_password_err)) { 34 | # Prepare a select statement 35 | $sql = "SELECT id, username, password FROM users WHERE username = ? OR email = ?"; 36 | 37 | if ($stmt = mysqli_prepare($link, $sql)) { 38 | # Bind variables to the statement as parameters 39 | mysqli_stmt_bind_param($stmt, "ss", $param_user_login, $param_user_login); 40 | 41 | # Set parameters 42 | $param_user_login = $user_login; 43 | 44 | # Execute the statement 45 | if (mysqli_stmt_execute($stmt)) { 46 | # Store result 47 | mysqli_stmt_store_result($stmt); 48 | 49 | # Check if user exists, If yes then verify password 50 | if (mysqli_stmt_num_rows($stmt) == 1) { 51 | # Bind values in result to variables 52 | mysqli_stmt_bind_result($stmt, $id, $username, $hashed_password); 53 | 54 | if (mysqli_stmt_fetch($stmt)) { 55 | # Check if password is correct 56 | if (password_verify($user_password, $hashed_password)) { 57 | 58 | # Store data in session variables 59 | $_SESSION["id"] = $id; 60 | $_SESSION["username"] = $username; 61 | $_SESSION["loggedin"] = TRUE; 62 | 63 | # Redirect user to index page 64 | echo ""; 65 | exit; 66 | } else { 67 | # If password is incorrect show an error message 68 | $login_err = "The email or password you entered is incorrect."; 69 | } 70 | } 71 | } else { 72 | # If user doesn't exists show an error message 73 | $login_err = "Invalid username or password."; 74 | } 75 | } else { 76 | echo ""; 77 | echo ""; 78 | exit; 79 | } 80 | 81 | # Close statement 82 | mysqli_stmt_close($stmt); 83 | } 84 | } 85 | 86 | # Close connection 87 | mysqli_close($link); 88 | } 89 | ?> 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | User login system 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 |
107 |
108 |
109 | " . $login_err . "
"; 112 | } 113 | ?> 114 |
115 |

Log In

116 |

Please login to continue

117 | 118 |
" method="post" novalidate> 119 |
120 | 121 | 122 | 123 |
124 |
125 | 126 | 127 | 128 |
129 |
130 | 131 | 132 |
133 |
134 | 135 |
136 |

Don't have an account ? Sign Up

137 |
138 | 139 |
140 |
141 |
142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 167 | 168 | 169 |
170 | Home 171 | Kids 172 | Adults 173 | 174 | 175 | 176 |
177 |

Muthu's toys store

178 |
179 | 180 |
181 |
1 / 3
182 | 183 |
Home
184 |
185 | 186 |
187 |
2 / 3
188 | 189 |
Kids
190 |
191 | 192 |
193 |
3 / 3
194 | 195 |
Adults
196 |
197 | 198 | 199 | 200 | 201 |
202 |
203 | 204 |
205 | 206 | 207 | 208 |
209 | 210 | 238 | 239 | 240 | 241 | -------------------------------------------------------------------------------- /register.php: -------------------------------------------------------------------------------- 1 | " . "alert('Oops! Something went wrong. Please try again later.')" . ""; 40 | } 41 | 42 | # Close statement 43 | mysqli_stmt_close($stmt); 44 | } 45 | } 46 | } 47 | 48 | # Validate email 49 | if (empty(trim($_POST["email"]))) { 50 | $email_err = "Please enter an email address"; 51 | } else { 52 | $email = filter_var($_POST["email"], FILTER_SANITIZE_EMAIL); 53 | if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { 54 | $email_err = "Please enter a valid email address."; 55 | } else { 56 | # Prepare a select statement 57 | $sql = "SELECT id FROM users WHERE email = ?"; 58 | 59 | if ($stmt = mysqli_prepare($link, $sql)) { 60 | # Bind variables to the statement as parameters 61 | mysqli_stmt_bind_param($stmt, "s", $param_email); 62 | 63 | # Set parameters 64 | $param_email = $email; 65 | 66 | # Execute the prepared statement 67 | if (mysqli_stmt_execute($stmt)) { 68 | # Store result 69 | mysqli_stmt_store_result($stmt); 70 | 71 | # Check if email is already registered 72 | if (mysqli_stmt_num_rows($stmt) == 1) { 73 | $email_err = "This email is already registered."; 74 | } 75 | } else { 76 | echo ""; 77 | } 78 | 79 | # Close statement 80 | mysqli_stmt_close($stmt); 81 | } 82 | } 83 | } 84 | 85 | # Validate password 86 | if (empty(trim($_POST["password"]))) { 87 | $password_err = "Please enter a password."; 88 | } else { 89 | $password = trim($_POST["password"]); 90 | if (strlen($password) < 8) { 91 | $password_err = "Password must contain at least 8 or more characters."; 92 | } 93 | } 94 | 95 | # Check input errors before inserting data into database 96 | if (empty($username_err) && empty($email_err) && empty($password_err)) { 97 | # Prepare an insert statement 98 | $sql = "INSERT INTO users(username, email, password) VALUES (?, ?, ?)"; 99 | 100 | if ($stmt = mysqli_prepare($link, $sql)) { 101 | # Bind varibales to the prepared statement as parameters 102 | mysqli_stmt_bind_param($stmt, "sss", $param_username, $param_email, $param_password); 103 | 104 | # Set parameters 105 | $param_username = $username; 106 | $param_email = $email; 107 | $param_password = password_hash($password, PASSWORD_DEFAULT); 108 | 109 | # Execute the prepared statement 110 | if (mysqli_stmt_execute($stmt)) { 111 | echo ""; 112 | echo ""; 113 | exit; 114 | } else { 115 | echo ""; 116 | } 117 | 118 | # Close statement 119 | mysqli_stmt_close($stmt); 120 | } 121 | } 122 | 123 | # Close connection 124 | mysqli_close($link); 125 | } 126 | ?> 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | User login system 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 |
144 |
145 |
146 |
147 |

Sign up

148 |

Please fill this form to register

149 | 150 |
" method="post" novalidate> 151 |
152 | 153 | 154 | 155 |
156 |
157 | 158 | 159 | 160 |
161 |
162 | 163 | 164 | 165 |
166 |
167 | 168 | 169 |
170 |
171 | 172 |
173 |

Already have an account ? Log In

174 |
175 | 176 |
177 |
178 |
179 |
180 | 181 | 182 | --------------------------------------------------------------------------------