PHP Project New Format
PHP Project New Format
MICRO-PROJECT REPORT
This is to certify that Mr./ Ms. DURGA ARAMSING RAJPUT of 6th Semester
of Diploma in Computer engineering of Institute Shreeyash college of
engineering and technology (Polytechnic), chh. Sambhaji Nagar has successfully
completed Micro-Project Work in Course of Engineering Department for the
academic year 2023-24 as prescribed in the I-Scheme Curriculum.
Seal of Institute
ACKNOWLEDGEMENT
1.0 Rationale:-
The art gallery is where the arts or art crafts of the artists can be
displayed for the visitors’ view. People additionally comment on arts that artist’s
show so that there will be some scope of improvement of the arts that is displayed.
Online Art gallery project However, these days because of the busy schedule of the
people, they don’t have time schedule-wise to visit the art gallery to view the
paintings of the famous artist. Online Art gallery project Yet, imagine a scenario
where the artist display is available on the online Indeed, it is conceivable. The
online art gallery is the application that enables the clients to transfer their paintings
and make it available to the visitors’ view.
1. Login Page
<html>
<head>
<title>Login</title>
<style>
body{
margin-top:
100px; margin-
bottom: 100px;
margin-right:
150px; margin-
left: 80px;
background-color:
azure ;color:
palevioletred;
font-family:
verdana;font-
size: 100%
}
h
1{
color:
indig
o;
font-family:
verdana;font-
size: 100%; }
h3 {
color: indigo;
font-family:
verdana;font-
size: 100%;
} </style>
</head>
<body>
<center><h1>WELCOME TO ONLINE ART GALLERY</h1></center>
<p><a href="register.php">Register</a> | <a href="login.php">Login</a></p>
<center><h3>Login Form</h3> </center>
<form action="" method="POST">
<legend><fieldset><center>
Username: <input type="text" name="user"><br><br>
Password: <input type="password"
name="pass"><br><br>
<input type="submit" value="Login" name="submit" onclick="cart.php"style="background-
color:lightblue; color: darkblue" >
</center></fieldset></legend></form>
<?php
if(isset($_POST["submit
"])){
if(!empty($_POST['user']) && !empty($_POST['pass'])) {
$user=$_POST['user'];
$pass=$_POST['pass'];
$con=mysqli_connect('localhost','root','','product2') or die(mysql_error());
//mysqli_select_db('product2',$con) or die("cannot select DB");
$query=mysqli_query($con,"SELECT * FROM user WHERE name='".$user."'AND
password='".
$pass."'");
$numrows=mysqli_num_rows($quer
y);if($numrows!=0)
{
while($row=mysqli_fetch_assoc($query))
{
$dbusername=$row['name'];
$dbpassword=$row['password'];
}
/* Redirect browser */
header("Location:
cart.php");
}
} else {
echo "Invalid username or password!";
} } else {
echo "All fields are required!"; }
} ?>
</body>
</html>
2. Registration Page
<html>
<head>
<title>Register</title>
<style>
body{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
background-color: azure ;
color: palevioletred;
font-family: verdana;
font-size: 100%
}
h1 {
color: indigo;
font-family: verdana;
font-size: 100%;
}
h2 {
color: indigo;
font-family: verdana;
font-size: 100%;
}</style>
</head>
<body>
<p><a href="register.php">Register</a> | <a href="login.php">Login</a></p>
<center><h2>Registration Form</h2></center>
<form action="" method="POST">
<legend>
<fieldset>
<table border="1px" cellpadding="5px" align="center" style="color: black; text-align: center; background-
color: lightgrey"><br/>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td>NAME:</td>
<td><input type=text name=user size=30></td>
<td>CONTACT:</td>
<td><input type=text name=contact size=30></td>
<td>E-MAIL:</td>
<td><input type=email name=email size=30></td>
<td>CITY:</td>
<td><input type=text name=city size=30></td>
<td>PASSWORD:</td>
<td><input type=password name=pass size=30></td>
$result=mysqli_query($con,$sql);
if($result){
echo "Account Successfully Created";
} else {
echo "Failure!";
}
} else {
echo "That username already exists! Please try again with another.";
}
} else {
echo "All fields are required!";
}
}
?>
</body>
</html>
3. Cart Page
<?php
session_start();
$connect = mysqli_connect("localhost", "root", "", "product2");
$tot=0;
if(isset($_POST["add_to_cart"]))
{
if(isset($_SESSION["shopping_cart"]))
{
$item_array_id = array_column($_SESSION["shopping_cart"], "item_id");
if(!in_array($_GET["id"], $item_array_id))
{
$count = count($_SESSION["shopping_cart"]);
$item_array = array(
'item_id' => $_GET["id"],
'item_name' => $_POST["hidden_name"],
'item_price' => $_POST["hidden_price"],
'item_quantity' => $_POST["quantity"]
else{
);
$_SESSION["shopping_cart"]
[$count] = $item_array;
echo '<script>alert(
?>
<div class="col-md-4">
<form method="post" action="cart.php?action=add&id=
<?php echo $row["id"]; ?>">
<div style="border:1px
solid #555;
background-color:#f2f2f2;border-radius:5px;
padding:16px;"align="center"
<imgsrc="images/<?phpcho$row["image"];?>"
class="img-responsive"width="200"height="200"/><br />
control" />
echo $row["name"]; ?>" />
<h4><?php echo $row["name"]; ?></h4>
<h4><?php echo $row["price"]; ?></h4>
<input type="text" name="quantity"
value="1" class="form-
<input type="hidden" name="hidden_name" value="<?php
font-family: verdana;
font-size: 100%;
}
h2 {
color: indigo;
font-family: verdana;
font-size: 100%;
}</style>
</head>
<body>
<form action="" method="POST">
<table border="1px" cellpadding="5px"align="center"style="color:black; text-align:center;
background-color: lightgrey"><br/>
<tr>
<td>NAME:</td>
<td><input type=text name=user size=30 value=<?php echo $name;?> ></td </tr>
<tr>
<td>CONTACT:</td>
<td><input type=text name=contact size=30 value=<?php echo $num;?>></td>
</tr>
<tr>
<td>E-MAIL:</td>
<td><input type=email name=email size=30 value=<?php echo $em;?>></td></tr><tr>
<td>CITY:</td>
<td><input type=text name=city size=30 value=<?php echo $city;?>></td></tr>
<tr><td>Total Amount:</td>
<td><?php echo "Rs.".$_SESSION['tot'];?></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Confirm Order" name="submit"></td>
</tr></table></form></body></html>
<?php
if(isset($_POST["submit"]))
{
$n=$_POST["user"];
$c=$_POST["contact"];
$e=$_POST["email"];
$ci=$_POST["city"];
require_once('C:\xampp\lib\class.phpmailer.php');
require_once('C:\xampp\lib\class.smtp.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = "smtp.gmail.com";
$mail->Port = 25;
$mail->Username ="[email protected]";
$mail->Password ="asmeeta2001 @";
$mail->setFrom('[email protected]');
$mail->addAddress($e);
$mail->IsHTML(true);
sr.
No. Name of Specifications Qty Remarks
Resource/material
Hardware Resource Desktop with Intel Core 2 -
1 Duo 1
2.93 GHz, RAM 2GB, HDD
160 GB
2 Software Resource -Xampp, Notepad++ 1 -
(A) (B)
Process and Product Individual Presentation/ Total Marks
Assessment (6 marks) Viva (4 marks) 10