New PHP MySQL Tutorials in Urdu/Hindi part 19 $ FILES method




Visit: http://www.onlineustaad.com for all of my tutorials in Urdu/Hindi. In this new series of my tutorials on PHP and MySQL you’ll learn it from basic to its …

source


14 responses to “New PHP MySQL Tutorials in Urdu/Hindi part 19 $ FILES method”

  1. bhai muje es me bht masla aa raha h yr jb me echo karwata hu na to your file is uploaded to file upload ni hote q k muje lagta h ye statment nai kar kar rahi move_uploaded_file($image_tmp, "$image_name"); object not found ata h kindly es me meri thori c help kar den

  2. Sir,Assalamo Alaikum Warahmatullah,
    move_uploaded_file($image_tmp, "$image_name"); why is $image-name in double quotation marks it's works also without these??????? Thank you

  3. sir g mara Notice: Undefined variable: image_tmp in C:wamp64wwwphptraining14_files.php on line 20 error show ho raha ha jab ma move_uploaded_file() likhta hon to ya error sho hota ha syntax mara bilkul ap jasa ha but phir b error sho hota ha
    mari codding ma ager koy masla ha to plz bata din.
    <html>
    <head>
    <title>PHP file array</title>
    </head>
    <body>
    <form method="post" action="14_files.php" enctype="multipart/form-data">
    Upload Image: <input type="file" name="image"><br><br>
    <input type="submit" name="upload" value="Upload now">
    </form>
    </body>
    </html>
    <?php
    // php $_FILES array
    if(isset($_POST['upload'])){
    echo $image_name = $_FILES['image']['name']."<br>";
    echo $image_type = $_FILES['image']['type']."<br>";
    echo $image_type = $_FILES['image']['size']."<br>";
    echo $image_tmp = $_FILES['image']['tmp_name']."<br>";
    }
    move_uploaded_file($image_tmp,"$image_name");
    echo "file has been uploaded!";
    ?>

  4. <body>

    <form align="center" method="post" action="index.php" enctype="multipart/form-data">

    Upload image <input type="file" name="image" />
    <input type="submit" name="upload" value="Upload Now" />
    </form>

    <?php
    if(isset($_POST ['upload'])){
    $image_name =$_FILES ['image']['name'];
    $image_type =$_FILES ['image']['type'];
    $image_size =$_FILES ['image']['size'];

    move_uploaded_file($image_temp,"$image_name");
    echo "File is uploaded";

    }

    ?>
    Upload image Choose File Upload Now

    Notice: Undefined index: image in C:xampphtdocsphp trainingindex.php on line 18

    Notice: Undefined index: image in C:xampphtdocsphp trainingindex.php on line 19

    Notice: Undefined index: image in C:xampphtdocsphp trainingindex.php on line 20

    Notice: Undefined variable: image_temp in C:xampphtdocsphp trainingindex.php on line 22
    File is uploaded

  5. IMAGE UPLOAD NAHI HO RAHI PLZ CHECK IT SIR ??

    <html>
    <head>
    <title>$_FILES METHOD</title>
    </head>

    <body>

    <form align="center" method="POST" action="$_FILES.php" enctype=
    "multipart/form-data">

    Upload Image: <input type="file" name="image"><br>

    <input type="submit" name="upload" value="Upload now">

    </form>
    </body>
    </html>

    <?php

    if (isset($_POST['upload']))
    {
    echo "<b>Image Name:</b> ".$img_name = $_FILES ['image']['name'] ."<br>";
    echo "<b>Image Type:</b> ".$img_type = $_FILES ['image']['type'] ."<br>";
    echo "<b>Image Size:</b> ".$img_size = $_FILES ['image']['size'] ."<br>";
    echo "<b>Image Temp Name:</b> ".$img_tmp = $_FILES ['image']['tmp_name'] ."<br>";

    move_uploaded_file($img_tmp,"$img_name");

    echo "File has been uploaded !<br> " ;

    echo "<b>Your image is here:</b><br>" ;
    echo "<center><img src='$img_name'></center>" ;
    }
    ?>

  6. Notice: Undefined index: image in C:xampphtdocsexamplefile.php on line 14

    run nahi kar raha sir

    <html>
    <head>
    <title>$_files</title>
    </head>
    <body>
    <form action="file.php" method="post" enctype="multipart/form_data" align="center">
    upload image:<input type="file" name="image" ><br/></br/>
    <input type="submit" name="upload" value="upload now">
    </body>
    </html>
    <?php
    if(isset($_POST['upload']))
    {
    echo $image_name=$_FILES["image"]["name"];
    echo $image_tmp=$_FILES["image"]["tmp_name"];
    $move_uploaded_file($image_tmp, "$image_name");
    echo "file has been uploaded";
    }
    ?>

Leave a Reply