Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Saturday, 11 February 2017

Easy Code for create folder to zip folder in php

<?php
function Zip($source, $destination)
{
    if (!extension_loaded('zip') || !file_exists($source)) {
        return false;
    }

    $zip = new ZipArchive();
    if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
        return false;
    }

Thursday, 9 February 2017

Very easy way Upload File Using PHP

File uploading using php is very simple, follow this step by step tutorial to upload file


Make a Form First
    <form action="" method="post" enctype="multipart/form-data">
        <input type="file" name="upload_file">
        <input type="submit" name="submit">
    </form>
   

Thursday, 2 February 2017

Mysql Database connection in php

 Before you can get content out of your MySQL database, you must know how to establish a connection to MySQL from inside a PHP script. To perform basic queries from within MySQL is very easy. This article will show you how to get up and running.

Let's get started. The first thing to do is connect to the database.The function to connect to MySQL is called mysql_connect. This function returns a resource which is a pointer to the database connection. It's also called a database handle, and we'll use it in later functions. Don't forget to replace your connection details.