In my application, I store the pictures as blob in the mysql db.
Now I want to display the pictures in my web application.
Now the Problem is:
The images are not displayed. Just a small sign. I'm not getting any error message.
I don't know how to update my project, to display the pictures
Model function:
public function create($fileName, $fileType, $fileSize, $fileContent, $gallery){
$query = "INSERT INTO $this->tableName (name, type, size, content, gallery_ID) VALUES (?, ?, ?, ?, ?)";
$statement = ConnectionHandler::getConnection()->prepare($query);
$statement->bind_param('ssisi', $fileName, $fileType, $fileSize, $fileContent, $gallery);
$success = $statement->execute();
if (!$success) {
throw new Exception($statement->error);
}
}
public function listByID($galleryID){
$query = "SELECT * from $this->tableName where gallery_ID = ?";
$statement = ConnectionHandler::getConnection()->prepare($query);
$statement->bind_param('i', $galleryID);
$statement->execute();
$result = $statement->get_result();
if (!$result) {
throw new Exception($statement->error);
}
$rows = array();
while ($row = $result->fetch_object()) {
$rows[] = $row;
}
return $rows;
}
Controller Method:
public function doAddPhoto(){
$fileName = $_FILES['fileToUpload']['name'];
$fileSize = $_FILES['fileToUpload']['size'];
$fileType = $_FILES['fileToUpload']['type'];
$tmpName = $_FILES['fileToUpload']['tmp_name'];
$gallery = $_SESSION['gallery'];
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
if($_FILES['fileToUpload']['size'] <= 0 ){
echo '<div class="alert alert-danger" id="messsage" role="alert">No Picture selected</div>';
}
else if ($_FILES["fileToUpload"]["size"] > 4194304) {
echo '<div class="alert alert-danger" id="messsage" role="alert">File to big</div>';
}
else if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
echo '<div class="alert alert-danger" id="messsage" role="alert">Sorry, only JPG, JPEG, PNG & GIF files are allowed.</div>';
}
else {
$fp = fopen($tmpName, 'r');
$fileContent = fread($fp, filesize($tmpName));
fclose($fp);
if(!get_magic_quotes_gpc()){
$fileName = addslashes($fileName);
}
$photoModel = new PhotoModel();
$photoModel->create($fileName, $fileType, $fileSize, $fileContent, $gallery);
}
header('location: /gallery/ListGalleriesPerUserOverview');
}
public function showPhotosPerUser(){
if (!isset($_SESSION ['loggedin']) || $_SESSION ['loggedin'] != true)
{
header('location: /');
return;
}
else{
$view = new View('gallery');
$galleryID = $_SESSION['gallery'];
$photoModel = new PhotoModel($galleryID);
$photos = $photoModel->listByID($galleryID);
$view->photos = $photos;
$view->display();
}
}
HTML:
<form action="/photo/doAddPhoto" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="uploadBtn">
</form>
<?php
foreach ($photos as $photo){
$content = $photo->content;
echo '<div class="col-md-3 portfolio-item">
<a href="#">
<img src="data:image/jpeg;base64,'. base64_encode($content) .'" />
</a>
</div>';
}
?>
Related
I have this php photo gallery, however my "mysqli_stmt_prepare" statement seems to be failing in someway. However, when I check my DB, the files that are in accordance to the upload rules, I created in my code, have been uploaded.
The message I get each time I upload a file to the DB is the one corresponding to a failed "mysqli_stmt_prepare", namely as in the code:
echo "SQL statement failed! 1"
<?php
if (isset($_POST['submit'])) {
$newFileName = $_POST['filename'];
//sets the file name to "gallery"
if (empty($_POST['filename'])) {
$newFileName = "gallery";
//adds hyphens to empty spaces
} else {
$newFileName = strtolower(str_replace(" ", "-", $newFileName));
}
$imageTitle = $_POST['filetitle'];
$imageDesc = $_POST['filedesc'];
$file = $_FILES['file'];
$fileName = $file['name'];
$fileType = $file['type'];
$fileTempName = $file['tmp_name'];
$fileError = $file['error'];
$fileSize = $file['size'];
$fileExt = explode(".", $fileName);
$fileActualExt = strtolower(end($fileExt));
$allowed = array("jpg", "jpeg", "png", "pdf");
if (in_array($fileActualExt, $allowed)) {
if ($fileError === 0) {
if ($fileSize < 200000) {
$imageFullName = $newFileName . "." . uniqid("uniqID", false) . "." . $fileActualExt;
$fileDestination = "../gallery/" . $imageFullName;
include_once "dbh.inc.php";
if (empty($imageTitle || $imageDesc)) {
header("Location: ../gallery.php?upload=empty");
echo "You didn't include the Image Title and Image description!";
exit();
} else {
$sql = "SELECT * FROM gallerytrexatek";
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql)) {
echo "SQL statement failed! 1";
} else {
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
$rowCount = mysqli_num_rows($result);
$setImageOrder = $rowCount + 1;
$sql = "INSERT INTO gallery (titleGallery, descGallery, imgFullNameGallery, orderGallery) VALUES (?, ?, ?, ?);";
if (!mysqli_stmt_prepare($stmt, $sql)) {
echo "SQL statement failed! 2";
} else {
mysqli_stmt_bind_param($stmt, "ssss", $imageTitle, $imageDesc, $imageFullName, $setImageOrder);
mysqli_stmt_execute($stmt);
move_uploaded_file($fileTempName, $fileDestination);
header("Location: ../galleryInPHP.php?upload=success");
}
}
}
} else {
echo "File Size is way to big";
exit();
}
} else {
echo "You had an error with the file";
exit();
}
} else {
echo "The file type you tried to upload is not allowed!";
exit();
}
}
?>
I expect the file to upload without problems. It seems I am overlooking something rather simple.
Hint: There are 3 files connected to this one.
1. The gallery.php where the form exists for images to be uploaded
2. The one which is pasted here
3. the DB handler file
Do'h, there was a problem with one of the file handler files.
I'm creating a PHP and SQL blog. Among other files, I have upload_file.php and edit_post.php. Every time I edit a post, it updates all the information except for the featured image. It won't upload a new featured image. Here is upload_file.php:
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
if (!empty($_FILES['post_image']['name'])) {
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["post_image"]["name"]);
$image_name = basename($_FILES["post_image"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["post_image"]["tmp_name"]);
if($check !== false) {
$file_image = "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
$file_not_image = "File is not an image.";
$uploadOk = 0;
}
}
// Check if file already exists
if (file_exists($target_file)) {
$file_exists = "Sorry, file already exists.";
$uploadOk = 0;
}
// Check file size
if ($_FILES["post_image"]["size"] > 5000000) {
$file_too_large = "Sorry, your file is too large.";
$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
$file_not_allowed = "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
$file_not_uploaded = "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["post_image"]["tmp_name"], $target_file)) {
$file_uploaded = "The file ". basename( $_FILES["post_image"]["name"]). " has been uploaded.";
} else {
$file_error = "Sorry, there was an error uploading your file.";
}
}
}
}
?>
Here is edit_post.php, minus the form:
<?php include("session_start.php")?>
<?php include("upload_file.php")?>
<?php include("links.php"); ?>
<?php include("navigation.php"); ?>
<?php
if($_GET['id'] != ""){
$post_id = $_GET['id'];
$sql = "SELECT * FROM posts WHERE post_id='$post_id' AND user_name='$user_name'";
$post = mysqli_query($connection, $sql) or die(mysqli_error($connection));
}
?>
<?php
$sql = "SELECT DISTINCT post_category FROM posts WHERE user_name='$user_name'";
$cat = mysqli_query($connection, $sql) or die(mysqli_error($connection));
?>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
$post_title = isset($_POST['post_title']) ? $_POST['post_title'] : null;
$post_content = isset($_POST['post_content']) ? $_POST['post_content'] : null;
if($_POST['new_category']==""){
$post_category = ($_POST['choose_category']);
}else{
$post_category = ($_POST['new_category']);
}
$post_date = isset($_POST['post_date']) ? $_POST['post_date'] : null;
if (isset($image_name)){
$sql = "UPDATE posts SET post_title='$post_title', post_content='$post_content', post_category='$post_category', post_date='$post_date', post_image='$image_name' WHERE post_id='$post_id' AND user_name='$user_name'";
}else{
$sql = "UPDATE posts SET post_title='$post_title', post_content='$post_content', post_category='$post_category', post_date='$post_date' WHERE post_id='$post_id' AND user_name='$user_name'";
}
$result = mysqli_query($connection, $sql) or die(mysqli_error($connection));
header('Location: index.php');
}
?>
<?php include "footer.php";?>
How can I fix this?
I just realized the reason this wasn't working is because I forgot to put enctype="multipart/form-data" on my form!
I am trying to set up a profile page where user can upload a profile picture. The problem I a having is that when the status is changed from 1 to 0 the image changes from a default profile image to a small black box with an "x" in it. Everything else works fine. I thought it might be the css but it is not. If anyone can assist, it would greatly appreciated. Thank you.
Profile.php:
<?php
$id= $_GET['id'];
$sql = "SELECT * FROM user WHERE id='$id'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$sqlImg = "SELECT * FROM profileImg WHERE id='$id'";
$resultImg = mysqli_query($conn, $sqlImg);
while ($rowImg = mysqli_fetch_assoc($resultImg)) {
echo "<div class='userProfileImage'>";
if ($rowImg['status'] == 0 ) {
echo "<img src='images/profile".$id.".jpg'>";
} else {
echo "<img src='images/profile_default.jpg'>";
}
echo "<p>".$row['first']."</p>";
echo "</div>";
}
}
} else {
echo "There are no users yet!";
}
uploadProfile.php:
<?php
session_start();
include '../dbh.php';
$id = $_SESSION['id'];
$userID = $id;
if (isset($_POST['submit'])) {
$file = $_FILES['file'];
$fileName = $_FILES['file']['name'];
$fileTmpName = $_FILES['file']['tmp_name'];
$fileSize = $_FILES['file']['size'];
$fileERROR = $_FILES['file']['error'];
$fileType = $_FILES['file']['type'];
$fileExt = explode('.', $fileName);
$fileActualExt = strtolower(end($fileExt));
$allowed = array('jpg', 'jpeg', 'gif', 'png', 'mov', 'mpeg4', 'mp4', 'avi', 'wmv', 'mpegps', 'flv', '3gpp', 'webm');
if (in_array($fileActualExt, $allowed)) {
if ($fileERROR === 0) {
if ($fileSize < 500000) {
$fileNameNew = "profile".$id.".".$fileActualExt;
$fileDestination = '../uploads/'.$fileNameNew;
$sql = "UPDATE profileImg SET status=0 WHERE id='$id'";
$result = mysqli_query($conn, $sql);
move_uploaded_file($fileTmpName, $fileDestination);
header("Location: ../profile.php?id=$userID");
} else {
echo "Your file is too large";
}
} else {
echo "There was an error uploading your file";
}
} else {
echo "You cannot upload files of this type";
}
}
?>
Files are being uploaded to uploads as line below
$fileDestination = '../uploads/'.$fileNameNew;
and img src is
echo "<img src='images/profile".$id.".jpg'>";
Please update you code.
Edit: you are allowing multiple extensions to be uploaded and on profile.php single extension is used to load the picture.
How can I submit form data with an optional upload file. I mean, can I submit form data together with an uploaded file? But I want to make the upload file optional. Here is the my code :
<?php
define ("MAX_SIZE","5000");
$errors=0;
if(($_SERVER["REQUEST_METHOD"] == "POST") && isset($_FILES["file"]["size"]) && ($_FILES["file"]["size"] > 0))
{
$image =$_FILES["file"]["name"];
$uploadedfile = $_FILES['file']['tmp_name'];
if ($image)
{
$filename = stripslashes($_FILES['file']['name']);
$extension = getExtension($filename);
$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif"))
{
$change='<div class="msgdiv">Unknown Image extension </div> ';
$errors=1;
}
else
{
$size=filesize($_FILES['file']['tmp_name']);
if ($size > MAX_SIZE*1024)
{
$change='<div class="msgdiv">You have exceeded the size limit!</div> ';
$errors=1;
}
if($extension=="jpg" || $extension=="jpeg" )
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
}
else if($extension=="png")
{
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefrompng($uploadedfile);
}
else
{
$src = imagecreatefromgif($uploadedfile);
}
echo $scr;
list($width,$height)=getimagesize($uploadedfile);
$newwidth=500;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
$newwidth1=300;
$newheight1=($height/$width)*$newwidth1;
$tmp1=imagecreatetruecolor($newwidth1,$newheight1);
imagealphablending($tmp1, false);
imagesavealpha($tmp1, true);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height);
$image_name=time().'_'.$_FILES['file']['name'];
$filename = "images/". $image_name;
$filename1 = "images/small_". $image_name;
$uid=$_SESSION['uid'];
imagejpeg($tmp,$filename,100);
imagejpeg($tmp1,$filename1,100);
imagedestroy($src);
imagedestroy($tmp);
imagedestroy($tmp1);
}}
}
if(isset($_POST['Submit']) && !$errors )
{
$category_group= $_POST['category_group'];
$title=$_POST['title'];
$details=$_POST['details'];
$ad_keywords=$_POST['ad_keywords'];
$category_state=$_POST['category_state'];
$category_city=$_POST['category_city'];
$address=$_POST['address'];
$telephone=$_POST['telephone'];
$email=$_POST['email'];
$website=$_POST['website_link'];
$price=$_POST['price'];
$filename= ($_FILES["file"]["size"] > 0) ? $filename : '';
$filename1= ($_FILES["file"]["size"] > 0) ? $filename1 : '';
$url=time().'-'. createUrl($title);
if(!$category_group || !category_city || !$title || !$details || !$category_state ){
echo "enter state and city name";
}else{
try{
$sth = $dbh->prepare("
INSERT INTO
advertisement(user_id,ad_image_big,ad_image_small,ad_cat_group,ad_title,ad_details,ad_state,ad_city,ad_address,ad_telephone,ad_email,ad_website,ad_price,ad_slug,ad_keywords)
VALUES(:field1,:field2,:field3,:field4,:field5,:field6,:field7,:field8,:field9,:field10,:field11,:field12,:field13,:field14,:field15)
");
$sth->execute(array(':field1' => $uid, ':field2' => $filename, ':field3' => $filename1, ':field4' => $category_group, ':field5' => $title, ':field6' => $details, ':field7' => $category_state,':field8'=> $category_city, ':field9' => $address, ':field10' => $telephone,':field11'=> $email,':field12'=> $website, ':field13' => $price, ':field14' => $url , ':field15'=> $ad_keywords));
}catch (PDOException $ex){
echo "An Error occured while inserting data to database";
some_logging_function($ex->getMessage());
}
header('location:success.php');
}
}
?>
Whenever I try to submit the form without the upload file I get this error:
"An Error occurred while inserting data to database"
which is in the catch section. If I upload a file, I get a success message without any error. Help me please.
Here is the code I made not long ago... Had the same problem :)
The form itself:
<form action="index.php" method="post" enctype='multipart/form-data'>
<input class="header_input" type="text" name="header" />
<br/><span class="input_headers"><p>Content</p></span>
<textarea class="textarea_input" rows="10" cols="30" name="content">
</textarea><br />
Select File: <input type='file' name='filename' size='10' /><br />
<input type="submit" class="submit" />
</form>
Altho it doesn't check, wether something is inputed into the "Header" and "Content" section, so try to fix that:
if (isset($_POST['header']) && isset($_POST['content'])) {
$header = mysql_real_escape_string(htmlentities($_POST['header']));
$content = mysql_real_escape_string(nl2br(htmlentities($_POST['content'])));
$sql = mysqli_query($con,"INSERT INTO posts (Header, Content) VALUES
('{$header}','{$content}')");
}
And this uploads the image, if there is one:
if (isset($_FILES['filename']['name'])) {
$name = htmlentities($_FILES['filename']['name']);
$allowedExts = array("gif", "jpeg", "jpg", "png");
$extension = end(explode(".", $_FILES['filename']['name']));
if ((($_FILES['filename']['type'] == "image/gif")
|| ($_FILES['filename']['type'] == "image/jpeg")
|| ($_FILES['filename']['type'] == "image/jpg")
|| ($_FILES['filename']['type'] == "image/pjpeg")
|| ($_FILES['filename']['type'] == "image/x-png")
|| ($_FILES['filename']['type'] == "image/png"))
&& ($_FILES['filename']['type'] < 20000)
&& in_array($extension, $allowedExts)) {
$result = mysqli_query($con,"SELECT * FROM posts WHERE PID=(SELECT max(PID) FROM posts)");
$row = mysqli_fetch_array($result);
$id = $row['PID'];
$new_name = $id . "_" . "000" . ".jpg";
if (file_exists("images/" . $new_name)) {
$new_name_ex = $id . "_" . "001" . ".jpg";
move_uploaded_file($_FILES['filename']['tmp_name'],"images/" . $new_name_ex);
$sql = mysqli_query($con,"UPDATE posts SET Images='{$new_name_ex}' WHERE PID='{$id}'");
} else {
move_uploaded_file($_FILES['filename']['tmp_name'],"images/" . $new_name);
$sql = mysqli_query($con,"UPDATE posts SET Images='{$new_name}' WHERE PID='{$id}'");
}
}
}
Hope that helps :) I am new to PHP, so maybe there is a way to make all of this code more simple, altho I hope it answers your question
From PHP Documentation (http://php.net/manual/en/features.file-upload.post-method.php), Example #3 Uploading array of files does pretty much what you need by walking through each file (in case you have an array of files) then the if statement checks whether the file is there. The code below is from the PHP documentation:
foreach ($_FILES["pictures"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
$name = $_FILES["pictures"]["name"][$key];
move_uploaded_file($tmp_name, "data/$name");
}
}
If there's no file, the code simply skips the upload and move on to the next.
I have the bellow code which I was hoping to change/rename image name on upload to user id so I can avoid file overwrite and insert the name into database sadly after I added rename code the code is not able to upload image or update the database we out showing any error but if I remove the rename code everything was working.
Can one help me how to solve it or is there any better way I can do it?
<?php
$user_id = htmlentities($_SESSION['user']['id'], ENT_QUOTES, 'UTF-8');
$username = htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8');
require("connection.php");
if(#$_POST ['submit']) {
$file = $_FILES ['file'];
$name1 = $file ['name'];
$type = $file ['type'];
$size = $file ['size'];
$tmppath = $file ['tmp_name'];
if($type == 'jpeg' || $type == 'png' || $type == 'jpg') {
$name1 = $user_id.$type; // rename image
if($name1!="") {
if(move_uploaded_file ($tmppath, 'users/'.$name1)) {
$sql=("INSERT INTO USERS set photo='$name1' WHERE username='$username'");
mysql_query ($sql) or die ('could not updated:'.mysql_error());
echo ("Profile picture updated");
}
}
}
}
?>
You can try this, may be help you ...
<?php
$user_id = htmlentities($_SESSION['user']['id'], ENT_QUOTES, 'UTF-8');
$username = htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8');
require("connection.php");
if(#$_POST ['submit']) {
$file = $_FILES ['file'];
$name1 = time().$file ['name']; // rename image
$type = $file ['type'];
$size = $file ['size'];
$tmppath = $file ['tmp_name'];
if($type == 'image/jpeg' || $type == 'image/png' || $type == 'image/jpg') {
if($name1!="") {
if(move_uploaded_file ($tmppath, 'users/'.$name1)) {
$sql=("INSERT INTO USERS set photo='$name1' WHERE username='$username'");
mysql_query ($sql) or die ('could not updated:'.mysql_error());
echo ("Profile picture updated");
}
}
}
}}
?>
First of all change
$name1 = $user_id.$type;
to
$name1 = $user_id.".".$type;
And second of all clean up you sql.
Also. file_type is image/jpeg so that's why it doesn't work. It never goes past your if.
Create a switch to check the filetype or just take the last 3 characters of the file.
Try this to reorganise your $_FILES into an array you can understand and easily work with.
Shameless plug
https://gist.github.com/lukeoliff/5531772#file-quickrearrangefiles-php
<?php
function rearrangeFiles($arr) {
foreach($arr as $key => $all){
foreach($all as $i => $val){
$new[$i][$key] = $val;
}
}
return $new;
}
Used as such:
<?php
$user_id = htmlentities($_SESSION['user']['id'], ENT_QUOTES, 'UTF-8');
$username = htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8');
require("connection.php");
if(!empty($_POST) && !empty($_FILES)) {
$files = rearrangeFiles($_FILES)
foreach ($files as $key => $file) {
$name = $file['name'];
$type = $file['type'];
$size = $file['size'];
$tmppath = $file['tmp_name'];
if($type == 'jpeg' || $type == 'png' || $type == 'jpg') {
$name = time() . '_' . $user_id.'_'.$name.'.'.$type; // TIMESTAMP, USERID and FILENAME RENAME
if(!empty($name)) {
if(move_uploaded_file($tmppath, 'users/'.$name)) {
$sql = "INSERT INTO users (photo,username) values ('$name','$username')";
mysql_query($sql) or die('could not updated:'.mysql_error());
$successes[] = $file['name'] . " picture saved as " . $name;
}
}
}
}
if (!empty($successes)) {
echo implode('. ',$successes);
}
}
Further improved by inserting into database in a single query :) Also you really need to move from mysql_ functions to mysqli_ or PDO:: functions as per php.net http://www.php.net/manual/en/function.mysql-connect.php depreciating mysql_ functions soon.
you can use that one concept, but edit this as your requirement.
<?php
if ($_FILES['imagepath']['name'] != "")
{
$uploaddir = 'images/';
$uploadfile = $uploaddir . basename($_FILES['imagepath']['name']);
if (move_uploaded_file($_FILES['imagepath']['tmp_name'], $uploadfile))
{
$rename = $_FILES['imagepath']['name'];
$rename = rand(0,1500000000).$rename;
$filename = strtolower(($rename));
if (file_exists(($uploaddir.$_FILES['imagepath']['name'])))
rename(($uploaddir.$_FILES['imagepath']['name']), ($uploaddir.$filename));
echo $_FILES['imagepath']['name']." with name ".$filename." file uploaded successfully";
}
}
?>