Skip to content
Snippets Groups Projects
Commit 9c92c95a authored by Girvandi Ilyas's avatar Girvandi Ilyas
Browse files

minor changes on edit-profile

parent 44cc477f
1 merge request!42Projekers - 13515051 - Girvandi Ilyas
...@@ -43,29 +43,26 @@ if(isset($_POST["submit"])) { ...@@ -43,29 +43,26 @@ if(isset($_POST["submit"])) {
$phone = $_POST['phone']; $phone = $_POST['phone'];
} }
if(file_exists($_FILES["image-file"]["tmp_name"])) { if(file_exists($_FILES["image-file"]["tmp_name"])) {
$targetDir = "../img/"; $targetDir = "../img/";
$targetFile = $targetDir . basename($_FILES["image-file"]["name"]); $targetFile = $targetDir . basename($_FILES["image-file"]["name"]);
$uploadOK = 1;
$imageFileType = pathinfo($targetFile,PATHINFO_EXTENSION);
$check = getimagesize($_FILES["image-file"]["tmp_name"]);
if($check !== false) {
$uploadOK = 1; $uploadOK = 1;
$imageFileType = pathinfo($targetFile,PATHINFO_EXTENSION); } else {
$check = getimagesize($_FILES["image-file"]["tmp_name"]); $uploadOK = 0;
if($check !== false) { }
$uploadOK = 1; if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
} else { && $imageFileType != "gif" ) {
$uploadOK = 0; $uploadOk = 0;
} }
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" if($uploadOK == 1) {
&& $imageFileType != "gif" ) { if (move_uploaded_file($_FILES["image-file"]["tmp_name"], $targetFile)) {
$uploadOk = 0; $image = basename($_FILES["image-file"]["name"]);
}
if($uploadOK == 1) {
if (move_uploaded_file($_FILES["image-file"]["tmp_name"], $targetFile)) {
$image = basename($_FILES["image-file"]["name"]);
}
}
if($uploadOK == 0) {
echo 'no';
} }
} }
}
if(isset($_POST['driver'])) { if(isset($_POST['driver'])) {
$isDriver = 1; $isDriver = 1;
} else { } else {
......
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
display: inline-block; display: inline-block;
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 350%; font-size: 300%;
vertical-align: middle; vertical-align: middle;
color: #02702C; color: #008800;
font-weight: bold; font-weight: bold;
font-family: Arial;
} }
.line { .line {
......
...@@ -46,11 +46,5 @@ function checkAllInput() { ...@@ -46,11 +46,5 @@ function checkAllInput() {
alert("Phone number must be valid"); alert("Phone number must be valid");
return false; return false;
} }
//Check image
var regexImage = /\.(jpe?g|png|gif)$/;
if(regexImage.test(image.value) == false) {
alert("Please upload image typed files only (.jpg, .jpeg, .png, .gif)!");
return false;
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment