insert image into database using php?

Put this code in action file
and $userprofiles_photopath = your photo folder path.


$userprofiles_photopath = $_POST['userprofiles_photopath_hidden'];
if($userprofiles_photopath == '')
{
if($_FILES['userprofiles_photopath']['name'] != '')
{
$userprofiles_photopath = '../userphotos' . '/' . $_FILES['userprofiles_photopath']['name'];
$tmp_name=$_FILES['userprofiles_photopath']['tmp_name'];
move_uploaded_file($tmp_name, $userprofiles_photopath);
}
}

and in form you add this code

<form name="" id="" enctype='multipart/form-data'>

</form>
 
Put this code in action file
and $userprofiles_photopath = your photo folder path.


$userprofiles_photopath = $_POST['userprofiles_photopath_hidden'];
if($userprofiles_photopath == '')
{
if($_FILES['userprofiles_photopath']['name'] != '')
{
$userprofiles_photopath = '../userphotos' . '/' . $_FILES['userprofiles_photopath']['name'];
$tmp_name=$_FILES['userprofiles_photopath']['tmp_name'];
move_uploaded_file($tmp_name, $userprofiles_photopath);
}
}

and in form you add this code

<form name="" id="" enctype='multipart/form-data'>

</form>
 
Back
Top