国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

簽名圖片路徑無法儲存到資料庫
P粉388945432
P粉388945432 2024-02-17 12:52:43
0
1
515

我使用 https://laratutorials.com/signature-pad-php-mysql-jquery/ 建立簽章板。 問題是當(dāng)我點擊提交時,簽名圖像路徑無法儲存到資料庫中。

這是 upload.php 的程式碼

<?php
include_once '../db_connect.php';

$folderPath = "upload/";

$image_parts = explode(";base64,", $_POST['signed']);
    
$image_type_aux = explode("image/", $image_parts[0]);
  
$image_type = $image_type_aux[1];
  
$image_base64 = base64_decode($image_parts[1]);
  
$file = $folderPath . uniqid() . '.'.$image_type;
$sql="INSERT INTO works (sign) VALUES ('$file') WHERE id=1";
mysqli_query($con,$sql);
  
file_put_contents($file, $image_base64);
echo "Signature Uploaded Successfully.";
?>

有人可以幫忙嗎?

P粉388945432
P粉388945432

全部回覆(1)
P粉402806175

mysql資料庫中的sign欄位將varchar改為文字欄位可以儲存在資料庫中

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板