Posts

Showing posts from August, 2017

Image Upload within Same Page display

<html> <head> <title>upload_file</title> </head> <body> <center> <form action="uploadimage.php" method="post" enctype="multipart/form-data" name="upload"> <table width="300" border="10"> <tr> <td>Select File</td> <td><input name="file" type="file" /></td> </tr> <tr> <td colspan="2"><center> <input name="sub" type="submit" value="upload" /> </center></td> </tr> </table> </form> </center> </body> </html> <?php error_reporting(0); if(isset($_POST['sub'])) { $name=$_FILES['file']['name']; $type=$_FILES['file']['type']; $size=$_FILES['file']['size']; $tmp=$_FILES['file']['tmp_name']; if($name=='...

Sign Up

sign.php <?php include ("config.php") ?> <!DOCTYPE html> <html> <head> <title> To Fill the Registration Form </title> <link rel="stylesheet" type="text/css" href="style.css"> <script src="jquery-3.2.1.min.js"></script> <script> $(document).ready(function(){ $("#p2").bind("blur",password_check) } ); function password_check() { var p1=$("#p1").val(); var p2=$("#p2").val(); if(p1!=p2) { $("#pass_err").html("mismatch password"); } else{ $("#pass_crr").html("correct password"); } } </script> </head> <body> <div id="header"></div> <div id="nav"> <center> <ul id="navul"> <li><a href="#">Home</a></li> <li><a href="#">product...

File Uploading With PHP and MySql

Try to upload any files(PDF, DOC, EXE, VIDEO, MP3, ZIP,etc...) index.php <?php include 'dbconfig.php'; ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>File Uploading With PHP and MySql</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body> <div id="header"> <label>File Uploading With PHP and MySql</label> </div> <div id="body"> <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="file" /> <button type="submit" name="btn-upload">upload</button> </form>     <br /><br />     <?php if(isset($_GET['success'])) { ?>         <label>File Uploaded Successfull...

To Store the images from database and show home page

Coding:- config.php <?php $con= new mysqli("localhost","root","","function"); if($con->connect_error) { echo $con->connect_error; die("sorry connected failed"); } else {   //echo "data connected successfully"; } ?> Index.php <!DOCTYPE html> <html> <head> <title>To Store the images from database </title> </head> <body> <h1> Welcome to muthu images uploads</h1> <form method="post" enctype="multipart/form-data"> <input type="file" name="image"> <input type="submit" name="submit" value="save"> </form> <?php if(isset($_POST["submit"])) { if(getimagesize($_FILES['image']['tmp_name'])==false) { echo 'please the select the images'; } else { $image=$_FILES['image...

How to remove .php, .html, .htm extensions with .htaccess

Ans:-  .htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^(.*)$ $1.html </IfModule>