Jump to content


New Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Sprint666l

  • Rank
  1. Sorry, I were away from pc, and yeah, I see this problem my bad. I made mistake. if(move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath)){ $insert = "UPDATE users SET profile_img='$fileName' WHERE username='".$_SESSION['username']."'"; $insert = mysqli_query($connect, $insert); if($insert){ $statusMsg = "The file ".$fileName. " has been uploaded successfully."; }else{ $statusMsg = "File upload failed, please try again."; } }else{ $statusMsg = "Sorry, there was an error uploading you
  2. I used your broken crystal ball. And I immediately realized that there was a mistake somewhere. I realy dont undestand PDO:: for me its realy hard to know it. 😕 (ironie) I II just used basic php. Thanks for help. Fixed code: if(isset($_POST["submit"]) && !empty($_FILES["file"]["name"])){ $statusMsg = ''; $targetDir = "images/"; $fileName = basename($_FILES["file"]["name"]); $targetFilePath = $targetDir . $fileName; $fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION); // Allow certain file formats $allowTypes = array('jpg','png','jpeg','gif','pdf
  3. Yah, I tried and still doesnt work, but now when I uploaded img new, image it will show in images / (name img.jpg). I need it to be uploaded to the database. Do you know how to fix it ? Because when I uploaded image show it error massage (File upload failed, please try again). I dont know what to do now.
  4. Hello guys, I got problem with this code im still beginer in coding(PDO), so I think, that someone help me with this code. when someone help me I will be realy glad :). this is error massage ->Warning: Undefined array key "file" in C:\xampp\htdocs\forum_2021\account.php on line 63 Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\forum_2021\account.php on line 63 <form action="" method="post" enctype="multipart/form-data"> Select Image File to Upload: <input type="file" name="file"> <input type="sub
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.