Webtech Codes
Webtech Codes
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?
<div class="btn_two">
family=Material+Symbols+Outlined:opsz,wght,FILL,GR
AD@24,400,0,0" /> <label for="check">
<meta name="viewport" content="width=device- <i class="fa-solid fa-xmark"></i>
width, initial-scale=1.0">
</label>
<link href="https://fonts.cdnfonts.com/css/amazon-
ember" rel="stylesheet"> </div>
<link href="https://fonts.googleapis.com/css2?
family=Major+Mono+Display&display=swap" <div class="menu">
rel="stylesheet">
<ul>
<link
<li>
href="https://fonts.googleapis.com/css2?
family=Poppins&display=swap" <i class="fa-solid fa-image"></i>
</div>
<div class="btn">
<button class="close">CLOSE</button>
<button class="checkOut">Check Out</button>
</div>
</div>
<!-- fourth block -->
<div class="totalAmount">Total Amount: $<span
id="totalAmountValue">0</span></div>
<div class="footer">
<p>GLOBO MART | Manipal University Jaipur | Web
Tech Project</p>
</div>
<script src="app.js"></script>
</body>
</html>
SIGN IN PAGE </div>
final_signin_page.html
<!DOCTYPE html> <div class="sidebar_menu">
<meta http-equiv="X-UA-Compatible"
content="IE=edge" /> <div class="btn_two">
<meta name="viewport" content="width=device- <label for="check">
width, initial-scale=1.0" />
<i class="fa-solid fa-xmark"></i>
<title></title>
</label>
<link rel="stylesheet" href="final_siginpage.css">
</div>
<link rel="preconnect"
href="https://fonts.googleapis.com" />
<link rel="preconnect" <div class="menu">
href="https://fonts.gstatic.com" crossorigin />
<ul>
<link href="https://fonts.googleapis.com/css2?
<li>
family=Major+Mono+Display&display=swap"
rel="stylesheet"> <i class="fa-solid fa-image"></i>
<link <a href="final_homepage.html">Home</a>
href="https://fonts.googleapis.com/css2? </li>
family=Poppins&display=swap"
<li>
rel="stylesheet"/>
<i class="fa-solid fa-arrow-up-right-from-
<link href="https://fonts.googleapis.com/css2? square"></i>
family=Major+Mono+Display&family=Montserrat&dis
play=swap" rel="stylesheet"> <a href="#">Wishlist</a>
<link </li>
rel="stylesheet" <li>
<ul>
<a href="#"><i class="fa-brands fa- <button class="sub" type="submit"
facebook"></i></i></a> value="register">Create Account</button>
} <label for="password2">Password:</label>
<head> </div>
amount:amount, </form>
key_id:RAZORPAY_ID_KEY, </div>
description:req.body.description, <img
src="https://cdn.pixabay.com/photo/2016/11/18/17/
contact:"8567345632", 20/living-room-1835923_960_720.jpg" alt="Shoes">
name: "Sandeep Sharma", <p>Shoes</p>
email: "[email protected]" <p><b>Amount: Rs. 4500</b></p>
}); <form class="pay-form">
} <input type="hidden" name="name"
value="Shoes">
else{ res.status(400).send({success:false,msg <input type="hidden" name="amount"
:'Something went wrong!'}); value="4500">
} <input type="hidden" name="description"
value="Shoes Buying">
}
<input type="submit" value="Pay Now">
);
</form>
} catch (error) {
</div>
console.log(error.message);
</body>
}
</html>
}
</html>
module.exports = {
<script
renderProductPage,
src="https://checkout.razorpay.com/v1/checkout.js"><
createOrder /script>
<script> },
$(document).ready(function(){ "theme": {
"color": "#2300a3"
$('.pay-form').submit(function(e){ }
e.preventDefault(); };
var formData = $(this).serialize(); var
$.ajax({ razorpayObject = new Razorpay(options);
url:"/createOrder",
razorpayObject.on('payment.failed', function
type:"POST", (response){
data: formData, alert("Payment Failed");
success:function(res){ });
razorpayObject.open();
if(res.success){
}
var options = {
else{
"key":
""+res.key_id+"", alert(res.msg);
"amount": }
""+res.amount+"", }
"curre })
ncy": "INR",
"nam
e": ""+res.product_name+"", });
"desc });
ription": ""+res.description+"", </script>
"imag
products.json
e": "https://dummyimage.com/600x400/000/fff",
[
"orde
r_id": ""+res.order_id+"", {
"hand "id": 1,
ler": function (response){
alert("Payment Succeeded"); "name":" LD01 LOUNGE CHAIR",
}, "price": 200,
"prefil "image": "1.png"
l": {
},
"contact":""+res.contact+"", {
"id": 2,
"name": ""+res.name+"",
"name":" LD02 LOUNGE CHAIR",
"price": 250,
"email": ""+res.email+""
"image": "2.png"
},
"notes" : { },
"description":""+res.description+"" {
"id": 3, // Establishing a connection to the database
"name":" LD03 LOUNGE CHAIR", $conn = new mysqli('localhost', 'root', '', 'test');
"price": 180, // Checking the connection
"image": "3.png" if ($conn->connect error) {
}, die('Connection Failed: ' . $conn->connect error);
... } else {
] // Preparing the INSERT statement
$stmt = $conn->prepare("INSERT INTO registration
(fullname, email, number, username, password)
paymentRoute.js VALUES (?, ?, ?, ?, ?)");
const express = require('express'); // Binding parameters
const payment_route = express(); $stmt->bind_param("ssiss", $fullname, $email,
$number, $username, $password);
payment_route.use(bodyParser.json()); $stmt->execute();
payment_route.get('/', ?>
paymentController.renderProductPage);
payment_route.post('/createOrder',
login.php
paymentController.createOrder);
<?php
$username = $_POST['username'];
module.exports = payment_route;
$password = $_POST['password'];
test.php
$con = new mysqli("localhost", "root", "", "test");
<?php
if ($con->connect error) {
$fullname = $_POST['fullname'];
die("Failed to connect: " . $con->connect error);
$email = $_POST['email'];
} else
$number = $_POST['number'];
{
$username = $_POST['username'];
$stmt = $con->prepare("SELECT * FROM registration
$password = $_POST['password'];
WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$stmt_result = $stmt->get_result();
if ($stmt_result->num_rows > 0) {
$data = $stmt_result->fetch_assoc();
if ($data['password'] === $password) {
// Start a session to maintain login status
session_start();
// Store user information in session variables if
needed
$_SESSION['username'] = $username;
// Redirect to homepage upon successful login
header("Location: final_homepage.html");
exit;
} else {
echo "<h2>Invalid Email or password</h2>";
}
} else {
echo "<h2>Invalid Email or password</h2>";
}
}
?>