Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here


Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.


Have an account? Sign In Now

You must login to ask question.


Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Tanya HostSinimo

Tanya HostSinimo Logo Tanya HostSinimo Logo

Tanya HostSinimo Navigation

  • Home
  • Web Hosting
  • SEO Checker
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Terms of Use
  • Privacy Policy
  • Cookie Policy
Home/ Questions/Q 406
Answered
shamir
  • 3
shamirBegginer
Asked: March 23, 20212021-03-23T11:00:28+08:00 2021-03-23T11:00:28+08:00In: PHP Language

KENAPA ATTACHMENT TAK MENJADI?

  • 3

Maaf nak tanya. Kenapa saya punya file upload xjadi. salah kat mana ya?

ni form

<!DOCTYPE html>
<html>
<body>

<form action=”upload.php” method=”post”>
Select image to upload:
<input type=”file” name=”fileToUpload” id=”fileToUpload”>
<input type=”submit” value=”Upload Image” name=”submit”>
</form>

</body>
</html>

ni upload.php

<?php
$target_dir = “uploads/”;
$target_file = $target_dir . basename($_FILES[“fileToUpload”][“name”]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image
if(isset($_POST[“submit”])) {
$check = getimagesize($_FILES[“fileToUpload”][“tmp_name”]);
if($check !== false) {
echo “File is an image – “ . $check[“mime”] . “.”;
$uploadOk = 1;
} else {
echo “File is not an image.”;
$uploadOk = 0;
}
}
?>

saya dapat koding ni dari w3school tapi xmanjadi. Boleh tolong x? Please..

php
  • 2 2 Answers
  • 73 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    taha Pundit
    2021-03-23T11:02:36+08:00Added an answer on March 23, 2021 at 11:02 am

    Kalau tengok ke form tu mcm missing ni je enctype=”multipart/form-data”

    bt mcm ni

    <form action=”upload.php” method=”post” enctype=”multipart/form-data”>

    Cuba balik pastu respond kat sini jadi ke x.

    • 1
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
    • shamir Begginer
      2021-03-23T11:04:59+08:00Replied to answer on March 23, 2021 at 11:04 am

      aah betul lah.. hahahaha…. tertinggal yang ni.. patutlah xjadi. terima kasih boskur

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
        • Report

Sidebar

Ask A Question

Stats

  • Questions 16
  • Answers 55
  • Best Answers 10
  • Users 11
  • Popular
  • Answers
  • suraya

    WEB HOSTING MANA SESUAI UNTUK BINA LAMAN WEB MACAM SHOPEE ...

    • 10 Answers
  • taha

    LAMAN WEB ANDA GUNA CMS APA? JOOMLA? WORDPRESS? DRUPAL?

    • 8 Answers
  • Wpuser

    Why my swift performance cache too big?

    • 6 Answers
  • LianapHarry0
    LianapHarry0 added an answer best packing provider March 24, 2023 at 11:51 am
  • Wpuser
    Wpuser added an answer Problem solved. Thanks again taha February 20, 2022 at 7:58 pm
  • taha
    taha added an answer It so easy because you have cpanel access. Just click… February 20, 2022 at 7:56 pm

Top Members

taha

taha

  • 2 Questions
  • 112 Points
Pundit
fadaman

fadaman

  • 0 Questions
  • 52 Points
Teacher
suraya

suraya

  • 0 Questions
  • 35 Points
Begginer

Trending Tags

+13472950001 coldfusion dedicated server hosting joomla lucee mysql php poll template web hosting wordpress продажа тугоплавких металлов

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

© 2021 Tanya HostSinimo. All Rights Reserved
Powered by HostSinimo.com

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.