<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ARIF</title>
    <description>The latest articles on DEV Community by ARIF (@arif0ne).</description>
    <link>https://dev.to/arif0ne</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F770673%2F55829aa2-5030-48c5-89a8-937b30643b71.jpg</url>
      <title>DEV Community: ARIF</title>
      <link>https://dev.to/arif0ne</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arif0ne"/>
    <language>en</language>
    <item>
      <title>How to fix Multiple image upload problem in PHP 7.4?</title>
      <dc:creator>ARIF</dc:creator>
      <pubDate>Thu, 04 Aug 2022 09:09:00 +0000</pubDate>
      <link>https://dev.to/arif0ne/how-to-fix-multiple-image-upload-problem-in-php-74-2gcb</link>
      <guid>https://dev.to/arif0ne/how-to-fix-multiple-image-upload-problem-in-php-74-2gcb</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UsuYYyor--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ilroqtucuzs22z5gp3dl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UsuYYyor--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ilroqtucuzs22z5gp3dl.png" alt="Image description" width="880" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here my html code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`&amp;lt;form action="" method="POST" enctype="multipart/form-data"&amp;gt;
                                &amp;lt;div class="input-group input-group-sm mb-3"&amp;gt;
                                    &amp;lt;label class="col-md-4 col-form-label text-md-right"&amp;gt;Catagory Name&amp;lt;/label&amp;gt;
                                    &amp;lt;div class="col-md-6"&amp;gt;
                                        &amp;lt;input type="text" class="form-control" name="catName" required&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;

                                &amp;lt;div class="input-group input-group-sm mb-3"&amp;gt;
                                    &amp;lt;label class="col-md-4 col-form-label text-md-right"&amp;gt;Project Details&amp;lt;/label&amp;gt;
                                    &amp;lt;div class="col-md-6"&amp;gt;
                                        &amp;lt;input type="text" class="form-control" name="proDetails" required&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;
                                &amp;lt;div class="input-group input-group-sm mb-3"&amp;gt;
                                    &amp;lt;label class="col-md-4 col-form-label text-md-right"&amp;gt;Project info&amp;lt;/label&amp;gt;
                                    &amp;lt;div class="col-md-6"&amp;gt;
                                        &amp;lt;input type="text" class="form-control" name="proDate"
                                            placeholder="Date of Project" required&amp;gt;
                                        &amp;lt;input type="text" class="form-control mt-3" name="proLocation"
                                            placeholder="Project Locaiton" required&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;

                                &amp;lt;div class="form-group row"&amp;gt;
                                    &amp;lt;label class="col-md-4 col-form-label text-md-right"&amp;gt;Project Frist Image
                                        Select&amp;lt;/label&amp;gt;
                                    &amp;lt;div class="col-md-6"&amp;gt;
                                        &amp;lt;input type="file" class="form-control" name="image1" autofocus required&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;

                                &amp;lt;div class="form-group row"&amp;gt;
                                    &amp;lt;label class="col-md-4 col-form-label text-md-right"&amp;gt;Project Second Image
                                        Select&amp;lt;/label&amp;gt;
                                    &amp;lt;div class="col-md-6"&amp;gt;
                                        &amp;lt;input type="file" class="form-control" name="image2" autofocus&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;

                                &amp;lt;div class="form-group row"&amp;gt;
                                    &amp;lt;label class="col-md-4 col-form-label text-md-right"&amp;gt;Project Third Image
                                        Select&amp;lt;/label&amp;gt;
                                    &amp;lt;div class="col-md-6"&amp;gt;
                                        &amp;lt;input type="file" class="form-control" name="image3" autofocus&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;

                                &amp;lt;div class="form-group row"&amp;gt;
                                    &amp;lt;label class="col-md-4 col-form-label text-md-right"&amp;gt;Project Fourth Image
                                        Select&amp;lt;/label&amp;gt;
                                    &amp;lt;div class="col-md-6"&amp;gt;
                                        &amp;lt;input type="file" class="form-control" name="image4" autofocus&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;

                                &amp;lt;div class="form-group row"&amp;gt;
                                    &amp;lt;label class="col-md-4 col-form-label text-md-right"&amp;gt;Project Fifth Image
                                        Select&amp;lt;/label&amp;gt;
                                    &amp;lt;div class="col-md-6"&amp;gt;
                                        &amp;lt;input type="file" class="form-control" name="image5" autofocus&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;

                                &amp;lt;div class="col-md-6 offset-md-4"&amp;gt;
                                    &amp;lt;button type="submit" name="submit" class="btn btn-info"&amp;gt;
                                        Upload
                                    &amp;lt;/button&amp;gt;
                                &amp;lt;/div&amp;gt;
                        &amp;lt;/div&amp;gt;
                        &amp;lt;/form&amp;gt;`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;here my php code :&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (isset($_POST['submit'])) {

    include("../database/db_connect.php");

    // Insert the data to the database 
    $catName = $_POST['catName'];
    $proDetails = $_POST['proDetails'];
    $proDate = $_POST['proDate'];
    $proLocation = $_POST['proLocation'];

    // all image name for php 
    $image1 = $_FILES['image1']['name'];
    $image2 = $_FILES['image2']['name'];
    $image3 = $_FILES['image3']['name'];
    $image4 = $_FILES['image4']['name'];
    $image5 = $_FILES['image5']['name'];


    // all images upload directory 
    $target_dir = "../assets/projects/";
    $target_file1 = $target_dir . basename($image1);
    $target_file2 = $target_dir . basename($image2);
    $target_file3 = $target_dir . basename($image3);
    $target_file4 = $target_dir . basename($image4);
    $target_file5 = $target_dir . basename($image5);

     // all images filetype here
     $imageFileType1 = strtolower(pathinfo($target_file1, PATHINFO_EXTENSION));
     $imageFileType2 = strtolower(pathinfo($target_file2, PATHINFO_EXTENSION));
     $imageFileType3 = strtolower(pathinfo($target_file3, PATHINFO_EXTENSION));
     $imageFileType4 = strtolower(pathinfo($target_file4, PATHINFO_EXTENSION));
     $imageFileType5 = strtolower(pathinfo($target_file5, PATHINFO_EXTENSION));

    // all images set extension 
    $extension1 = substr($image1, strlen($image1) - 4, strlen($image1));
    $extension2 = substr($image2, strlen($image2) - 4, strlen($image2));
    $extension3 = substr($image3, strlen($image3) - 4, strlen($image3));
    $extension4 = substr($image4, strlen($image4) - 4, strlen($image4));
    $extension5 = substr($image5, strlen($image5) - 4, strlen($image5));

    $allowed_extensions = array('.jpg', '.jpeg', '.png', '.gif');

    if ($_FILES['image1']['size'] &amp;gt; 302400 || $_FILES['image2']['size'] &amp;gt; 302400 || $_FILES['image3']['size'] &amp;gt; 302400 || $_FILES['image4']['size'] &amp;gt; 302400 || $_FILES['image5']['size'] &amp;gt; 302400) {
        echo "File is too large upload size is 300kb";
    } 

    else {
        if (!file_exists($target_file1)  || !file_exists($target_file2)  || !file_exists($target_file3)  || !file_exists($target_file4)  || !file_exists($target_file5)) {
             // move file in directory
             move_uploaded_file($_FILES['image1']['tmp_name'], $target_file1);
             // move file in directory
             move_uploaded_file($_FILES['image2']['tmp_name'], $target_file2);
             // move file in directory
             move_uploaded_file($_FILES['image3']['tmp_name'], $target_file3);
             // move file in directory
             move_uploaded_file($_FILES['image4']['tmp_name'], $target_file4);
             // move file in directory
             move_uploaded_file($_FILES['image5']['tmp_name'], $target_file5);

             $sql = "INSERT INTO `projects` (`cat_name`, `pro_details`, `pro_date`, `pro_location`, `pro_image_frist`, `pro_image_second`, `pro_image_third`, `pro_image_fourth`, `pro_image_fifth`) VALUES  ('$catName','$proDetails','$proDate','$proLocation','$target_file1','$target_file2','$target_file3','$target_file4','$target_file5')";
             $result = $conn-&amp;gt;query($sql);

             if ($result) {
                 echo "Data successfully inserted in the database";
             }

             else{
                 echo "Data not inserted in the database";
             }
          }

          elseif (!in_array($extension1, $allowed_extensions) || !in_array($extension2, $allowed_extensions) || !in_array($extension3, $allowed_extensions) || !in_array($extension4, $allowed_extensions) || !in_array($extension5, $allowed_extensions)) {
           echo"One or more image is not valid for upload in database. Only supported image type is jpg, png ,jpeg ,gif";
        }

       else {
        echo"One or more file is already exists in database";
        }
    }
  }`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dkuk8U40--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/onvx5yzymbh4dintdtz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dkuk8U40--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/onvx5yzymbh4dintdtz3.png" alt="Image description" width="880" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>mysql</category>
      <category>phpmyadmin</category>
      <category>html</category>
    </item>
    <item>
      <title>How to solve "Uncaught TypeError: Cannot read properties of undefined" in Javascript</title>
      <dc:creator>ARIF</dc:creator>
      <pubDate>Fri, 01 Apr 2022 18:54:45 +0000</pubDate>
      <link>https://dev.to/arif0ne/how-to-solve-uncaught-typeerror-cannot-read-properties-of-undefined-in-javascript-1789</link>
      <guid>https://dev.to/arif0ne/how-to-solve-uncaught-typeerror-cannot-read-properties-of-undefined-in-javascript-1789</guid>
      <description>&lt;p&gt;`// Search Chat &lt;br&gt;
const searchMessage = () =&amp;gt; {&lt;br&gt;
    const val = messageSearch.value.toLowerCase();&lt;br&gt;
    message.forEach(chat =&amp;gt; {&lt;br&gt;
        let name = chat.querySelectorAll("h5").textContent.toLowerCase();&lt;br&gt;
        if (name.indexOf(val) != -1) {&lt;br&gt;
            chat.style.display = "flex";&lt;br&gt;
        } else {&lt;br&gt;
            chat.style.display = "none";&lt;br&gt;
        }&lt;br&gt;
    });&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;//Search Message&lt;br&gt;
messageSearch.addEventListener("keyup", searchMessage);`&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>search</category>
      <category>html</category>
    </item>
    <item>
      <title>How to fix react js error "Cannot GET /" in local browser no server no webpack</title>
      <dc:creator>ARIF</dc:creator>
      <pubDate>Fri, 11 Mar 2022 20:25:01 +0000</pubDate>
      <link>https://dev.to/arif0ne/how-to-fix-react-js-error-cannot-get-in-local-browser-no-server-no-webpack-33a5</link>
      <guid>https://dev.to/arif0ne/how-to-fix-react-js-error-cannot-get-in-local-browser-no-server-no-webpack-33a5</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Mz1xDEmZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/omgmc5rhv5qb6t4ioa0m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Mz1xDEmZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/omgmc5rhv5qb6t4ioa0m.png" alt="Image description" width="880" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>json</category>
      <category>html</category>
    </item>
    <item>
      <title>This application file is deleted but this application not deleted the menu?</title>
      <dc:creator>ARIF</dc:creator>
      <pubDate>Sun, 27 Feb 2022 17:18:48 +0000</pubDate>
      <link>https://dev.to/arif0ne/this-application-file-is-deleted-but-this-application-not-deleted-the-menu-370a</link>
      <guid>https://dev.to/arif0ne/this-application-file-is-deleted-but-this-application-not-deleted-the-menu-370a</guid>
      <description>&lt;p&gt;Anyone have a idea how to delete this application completely?&lt;br&gt;
this application not showing the dpkg --list,then how i remove the application?&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QjmiwuR7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l00xe5ulx18zivml5c0x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QjmiwuR7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l00xe5ulx18zivml5c0x.png" alt="Image description" width="721" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>tor</category>
      <category>browser</category>
    </item>
    <item>
      <title>Can anyone help me why this error are show?</title>
      <dc:creator>ARIF</dc:creator>
      <pubDate>Tue, 25 Jan 2022 14:16:49 +0000</pubDate>
      <link>https://dev.to/arif0ne/can-anyone-help-me-why-this-error-are-show-1ml3</link>
      <guid>https://dev.to/arif0ne/can-anyone-help-me-why-this-error-are-show-1ml3</guid>
      <description>&lt;p&gt;`&amp;lt;?php &lt;br&gt;
    include_once "php/config.php";&lt;br&gt;
    $fname = mysqli_real_escape_string($conn, $_POST['fname']);&lt;br&gt;
    $lname = mysqli_real_escape_string($conn, $_POST['lname']);&lt;br&gt;
    $email = mysqli_real_escape_string($conn, $_POST['email']);&lt;br&gt;
    $password = mysqli_real_escape_string($conn, $_POST['password']);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (!empty($fname) &amp;amp;&amp;amp; !empty($lname) &amp;amp;&amp;amp; !empty($email) &amp;amp;&amp;amp; !empty($password)) {
    // lets users email valid or not 
    if (filter_var($email,FILTER_VALIDATE_EMAIL)) {

    }
    else{
      echo "$email + this is not a valid email";
    }
}
else{
    echo "All input fields are required";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;?&amp;gt;&lt;code&gt;&lt;br&gt;
&lt;/code&gt;const form = document.querySelector("#form");&lt;br&gt;
const continueBtn = form.querySelector("#conBtn");&lt;/p&gt;

&lt;p&gt;form.addEventListener("submit", (e) =&amp;gt; {&lt;br&gt;
    e.preventDefault();//preventing form from submiting&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;continueBtn.addEventListener("click", () =&amp;gt; {&lt;br&gt;
    // let's start Ajax&lt;br&gt;
    let xhr = new XMLHttpRequest();//creating xml object&lt;br&gt;
    xhr.open("POST", "php/signup.php", true);&lt;br&gt;
    xhr.onload = () =&amp;gt; {&lt;br&gt;
        if (xhr.readyState === XMLHttpRequest.DONE) {&lt;br&gt;
            if (xhr.status === 200) {&lt;br&gt;
                let data = xhr.response;&lt;br&gt;
                console.log(data);&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
    // we have to send the form data thourgh ajax to php&lt;br&gt;
    let formData = new FormData(form);//creating new formdata object&lt;br&gt;
    xhr.send(formData);//sending the form data to php&lt;br&gt;
});`&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rqZlOocp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hkgmpbsj4weduodad15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rqZlOocp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hkgmpbsj4weduodad15.png" alt="Image description" width="805" height="522"&gt;&lt;/a&gt;``&lt;/p&gt;

</description>
      <category>php</category>
      <category>javascript</category>
      <category>ajax</category>
      <category>http</category>
    </item>
  </channel>
</rss>
