🔒 Closed HELP PHP Library

Status
Not open for further replies.
idolo may references ka ba dyan? hehehe tsaka namomroblema pa ako sa photo uploading ko hahaha baka pwede mo ako gabayan please :D
php or php framework ?

idolo may references ka ba dyan? hehehe tsaka namomroblema pa ako sa photo uploading ko hahaha baka pwede mo ako gabayan please :D
image upload click here

You do not have permission to view the full content of this post. Log in or register now.
 
php or php framework ?


image upload click here

You do not have permission to view the full content of this post. Log in or register now.
core po sir dev, kasi gusto muna mapraktis ang core para mas familiar ako.. thank you

core po sir dev, kasi gusto muna mapraktis ang core para mas familiar ako.. thank you
1638750294907.webp

yan po sir pero uploaded naman na yung photo sa folder na nasa server. naubusan na ko ng masesearch kay google kaya baka kailangan ko na ng master hehe
 
$img_ext=explode(".",$image);
$image_ext=$img_ext['1'];
$image = rand(1,1000).rand(1,1000).time().".".$image_ext;
move_uploaded_file($tmp_image,"../sample/sample_img/$image");

ito idea
 
$img_ext=explode(".",$image);
$image_ext=$img_ext['1'];
$image = rand(1,1000).rand(1,1000).time().".".$image_ext;
move_uploaded_file($tmp_image,"../sample/sample_img/$image");

ito idea
naguupload sya sa folder kaso wala sa database column photo
 
varchar mo lang ung column type


patingin ng codes mo?

punta ka ng php.ini tas change mo ung file size upload based sa need mo.
<?php
include_once 'config/config.php';


$output_dir = "upload/";/* Path for file upload */
$RandomNum = time();
$ImageName = str_replace(' ','-',strtolower($_FILES['photo']['name'][0]));
$ImageType = $_FILES['photo']['type'][0];

$ImageExt = substr($ImageName, strrpos($ImageName, '.'));
$ImageExt = str_replace('.','',$ImageExt);
$ImageName = preg_replace("/\.[^.\s]{3,4}$/", "", $ImageName);
$NewImageName = $ImageName.'-'.$RandomNum.'.'.$ImageExt;
$ret[$NewImageName]= $output_dir.$NewImageName;

$permit_id = isset($_REQUEST['permit_id']);
/* Try to create the directory if it does not exist */
if (!file_exists($output_dir))
{
@mkdir($output_dir, 0777);
}
move_uploaded_file($_FILES["photo"]["tmp_name"][0],$output_dir."/".$NewImageName );
//$sql = "INSERT INTO permit(photo) VALUES ('$NewImageName') WHERE permit_code='$permit_code'";
$sql = "UPDATE permit SET photo='$ret[$NewImageName]' WHERE permit_id='$permit_id'";
if (mysqli_query($con, $sql)) {
//echo "successfully !";
echo "<script language='javascript'>alert('Photo " . $NewImageName. " Successfully!')</script>";
echo "<script>window.location.href='userrecords.php';</script>";
}
else {
echo "Error: " . $sql . "" . mysqli_error($con);
}

?>
 
Status
Not open for further replies.

About this Thread

  • 9
    Replies
  • 1K
    Views
  • 3
    Participants
Last reply from:
sandangkal

Trending Topics

Online now

Members online
1,023
Guests online
849
Total visitors
1,872

Forum statistics

Threads
2,272,771
Posts
28,945,136
Members
1,236,403
Latest member
KatsuraDaa
Back
Top