forked from bindumareedu/PhotoFlock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vanessa Pinto
authored and
Vanessa Pinto
committed
Apr 23, 2019
1 parent
0838276
commit 6275729
Showing
12 changed files
with
373 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
require('connect.php'); | ||
|
||
$data = $_GET['searchbox']; | ||
|
||
$query="SELECT * FROM imagestore WHERE (photographer_id like '%".$data."%') or (category like '%".$data."%') or (tags like '%".$data."%')"; | ||
$result = pg_query($connection, $query) or die('Query failed: ' . pg_last_error()); | ||
|
||
if($result){ | ||
echo "success"; | ||
} | ||
|
||
else { | ||
echo "error"; | ||
} | ||
|
||
pg_close($connection); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
require("connect.php"); | ||
|
||
if(isset($_POST['but_upload']) and isset($_POST['username'])){ | ||
|
||
$photographer = $_POST['username']; | ||
// $category = $_POST['category']; | ||
// $tags = $_POST['tags']; | ||
$name = $_FILES['file']['name']; | ||
$target_dir = "../profile/"; | ||
$target_file = $target_dir . basename($_FILES["file"]["name"]); | ||
|
||
// Select file type | ||
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); | ||
|
||
// Valid file extensions | ||
$extensions_arr = array("jpg","jpeg","png","gif"); | ||
|
||
// Check extension | ||
if(in_array($imageFileType,$extensions_arr) ){ | ||
|
||
// Upload file | ||
move_uploaded_file($_FILES['file']['tmp_name'],$target_dir.$name); | ||
chmod($target_dir.$name, 0755); | ||
// Insert record | ||
$query = "UPDATE public.users_info SET profilepic='$name' WHERE email = '$photographer'"; | ||
$result = pg_query($connection, $query) or die('Query failed: ' . pg_last_error()); | ||
// if($result){ | ||
// echo 'success'; | ||
// } | ||
// else { | ||
// echo 'error'; | ||
// } | ||
|
||
header('Location:../profile-photo.php'); | ||
|
||
} | ||
|
||
} | ||
pg_close($connection); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.