Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ArtGalleryProject/adminregisterlogin/aserver100.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
session_start();
// header('location: ../tanmay.html');

// variable declaration
$username = "";
Expand Down Expand Up @@ -33,7 +34,7 @@

$_SESSION['username'] = $username;
$_SESSION['success'] = "You are now logged in";
header('location: index100.php');
header('location: ../userregisterlogin/index100.php');
}

}
Expand All @@ -57,7 +58,7 @@
if (mysqli_num_rows($results) == 1) {
$_SESSION['username'] = $username;
$_SESSION['success'] = "You are now logged in";
header('location: index100.php');
header('location: ../userregisterlogin/index100.php');
}else {
array_push($errors, "Wrong username/password combination");
}
Expand Down
69 changes: 0 additions & 69 deletions ArtGalleryProject/adminregisterlogin/stylemodify.css

This file was deleted.

6 changes: 5 additions & 1 deletion ArtGalleryProject/artdatabase/artregister100.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html>
<head>
<title>Registration system PHP and MySQL</title>
<link rel="stylesheet" type="text/css" href="stylemodify.css">
<link rel="stylesheet" type="text/css" href="../stylemodify.css">
</head>
<body>
<div class="header">
Expand All @@ -27,6 +27,10 @@
<label>Category</label>
<input type="category" name="category" value="<?php echo $category; ?>">
</div>
<div class="input-group">
<label>Image</label>
<input type="file" name="image" value="<?php echo $image; ?>">
</div>
<div class="input-group">
<button type="submit" class="btn" name="reg_user">Register</button>
</div>
Expand Down
15 changes: 10 additions & 5 deletions ArtGalleryProject/artdatabase/artserver100.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
$artname = "";
$cost = "";
$category = "";
$image = "";
$errors = array();
$_SESSION['success'] = "";
$tanmay = 'tanmay sankhe';

// connect to database
$db = mysqli_connect('localhost', 'root', '', 'artdatabase');
Expand All @@ -17,24 +19,27 @@
$artname = mysqli_real_escape_string($db, $_POST['artname']);
$cost = mysqli_real_escape_string($db, $_POST['cost']);
$category = mysqli_real_escape_string($db, $_POST['category']);

$image = mysqli_real_escape_string($db, $_POST['image']);

// form validation: ensure that the form is correctly filled
if (empty($artname)) { array_push($errors, "artname is required"); }
if (empty($cost)) { array_push($errors, "cost is required"); }
if (empty($category)) { array_push($errors, "category is required"); }
if (empty($image)) { array_push($errors, "image is required"); }


// register user if there are no errors in the form
if (count($errors) == 0) {

$query = "INSERT INTO user(artname,cost,category)
VALUES('$artname','$cost','$category')";
$query = "INSERT INTO user(artname,cost,category,image)
VALUES('$artname','$cost','$category','$image')";
mysqli_query($db, $query);

$_SESSION['artname'] = $artname;
$_SESSION['success'] = "You are now logged in";
header('location: index100.php');
}
header('location: painting50.php');
echo "upload success";
}

}

Expand Down
14 changes: 14 additions & 0 deletions ArtGalleryProject/artdatabase/imagedisplay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$db = mysqli_connect('localhost', 'root', '', 'artdatabase');

$data = mysql_query("select * from user");
while($info = mysql_fetch_array($data)){
// print "<tr bgcolor = red>";
// print "<td>".$info['uname'];
// print "<td>".$info['rollno'];
// print "<td>".$info['city'];
print "tan";
print "<img src=../images/".$info['image'].">";
}
?>
69 changes: 46 additions & 23 deletions ArtGalleryProject/artdatabase/painting50.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@

<?php
include('artserver100.php');
// echo "helloooooooo"."<br>";
// echo $tanmay;
// echo "helloooooooo";
// $result=mysqli_query($db,"SELECT * from user");
// // $data=mysqli_fetch_assoc($result);
// // $abs = $data['image'];
// // echo $abs;
// // echo "<img src='../images/".$abs."' >";
// while($data=mysqli_fetch_assoc($result)){
// $abs = $data['image'];
// echo $abs;
// echo "<img src='../images/".$abs."' >";
// }

?>

<html lang="en">
<head>
Expand All @@ -13,26 +29,37 @@

<body style="background-color: #F5F5DC;">
<h1>Hey</h1>
<h1><?php echo ("m".$row['artname']) ?></h1>
<h1><?php echo $darshan ?></h1>
<div class="container-fluid">
<h1>Browse Art for Sale by Style
<h1>Browse Art for Sale by Style</h1>
<h4><p>See what's selling to collectors all over the world.</p></h4>

</div>



<div class="row" style="margin: 15px">
<div class="col-md-6">
<a target="_blank" href="art1.html">
<img src="<?php echo $ss; ?>;" alt="art1" width="600" height="380">
<div class="desc"><h3>$250</h3></div>
</a>



<div class="row" style="">

<?php
$result=mysqli_query($db,"SELECT * from user");
// $data=mysqli_fetch_assoc($result);
// $abs = $data['image'];
// echo $abs;
// echo "<img src='../images/".$abs."' >";
while($data=mysqli_fetch_assoc($result)){
$abs = $data['image'];
echo "<div class='col-lg-6'>";
echo "<img src='../images/".$abs."' height=500px width=500px>";
echo "<h1>".$data['artname']." ".$data['cost']."<h1></div>";
}

?>



</div>

<!--
<div class="col-md-4">
<a target="_blank" href="art2.html">
<img src="/images/art2.jpeg" alt="art1" width="600" height="380">
Expand Down Expand Up @@ -128,27 +155,23 @@
<br> <br><br>

</div>
<div>
<div> -->
<?php
$db=mysqli_connect("localhost","root","","artdatabase");
$query="SELECT * FROM user ";
$result=mysqli_query($db,$query);
while($row = mysqli_fetch_assoc($result)){
echo $row["artname"].$row["cost"].$row["category"];
}
// $db=mysqli_connect("localhost","root","","artdatabase");
// $query="SELECT * FROM user ";
// $result=mysqli_query($db,$query);
// while($row = mysqli_fetch_assoc($result)){
// echo $row["artname"].$row["cost"].$row["category"];
// }

?>
</div>








</div>

</div>
</body>
</head>
Expand Down
89 changes: 0 additions & 89 deletions ArtGalleryProject/database/artdatabase.sql

This file was deleted.

Loading