Posts

COMPLETE LOGIN SYSTEM IN PHP AND MYSQL

Image
                                        INDEX.PHP <?php session_start (); ? > <! DOCTYPE   html > < html   lang = " en " > < head >     < meta   charset = " UTF-8 " >     < title >login system</ title >     < link   rel = " stylesheet "   href = " css/style.css " > </ head > < body >     < nav >         < a   href = " #home " >< img   src = " image/logo.jpg "   id = " logo " ></ a >         < ul >             < li >< a   href = " #home " >Home</ a ></ li >             < li >< a   href = " #about " >About</ a ></ li >             < li >< a   href = " #contact " >Contact</ a ></ li >         </ ul >         < div   class = " login " >             < form   action = " includes/login.inc.php "   met

How to Upload More Than One File using PHP

Source Code:  1) count(array_or_countable) :Count all elements in an array, or something in an object. 2) in_array — Checks if a value exists in an array in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool needle = The searched value. haystack = The array. strict = If the third parameter strict is set to TRUE then the in_array() function will also check the types of the needle in the haystack. 3) pathinfo(path) — Returns information about a file path path = The path to be parsed. options: If present, specifies a specific element to be returned; one of PATHINFO_DIRNAME, PATHINFO_BASENAME, PATHINFO_EXTENSION or PATHINFO_FILENAME. 4) move_uploaded_file — Moves an uploaded file to a new location move_uploaded_file ( string $filename , string $destination ) : bool filename = The filename of the uploaded file. destination = The destination of the moved file.                                                                                               FI

php Upload and Download File

                                                      Upload.php <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <title>upload</title> </head> <body>        <?php     $conn = mysqli_connect('localhost','root','','example');     if(isset($_POST['submit'])){         $fileName = $_FILES['file']['name'];         $fileTmpName = $_FILES['file']['tmp_name'];         $path = "files/".$fileName;                  $query = "INSERT INTO filedownload(filename) VALUES ('$fileName')";         $run = mysqli_query($conn,$query);                  if($run){             move_uploaded_file($fileTmpName,$path);             echo "success";         }         else{             echo "error".mysqli_error($conn);         }              }          ?>        <table border="1px" align="