Skip to main content

Posts

How to change Dynamic URL to Static URL in php ?

The purpose of this post is How can change dynamic URL to Static URL in PHP with Example. Below Screenshot there are dynamic URL  Step 1  Create Example.php file in project folder Example.php Hiii this is Example for How to change dynamic URL to static URL in PHP Step 2 Create .htaccess file and put below content in this file RewriteEngine On RewriteRule ^test?$ Example.php After changes and refresh the page and check below result displayed
Recent posts

PHP CRUD with File Uploading Using Ajax

Ajax AJAX stands for  A synchronous  Ja vaScript and  X ML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS, and Java Script. The example is below for insert, update, delete and file uploading in PHP. Create files in a project folder like below : - Project     - db.php     - insert.php     - delete.php     - view.php db.php connect_error) { die("connecton failed".$conn->connect_error); } ?> insert.php connect_error) { die("Connection failed: " . $conn->connect_error); } if(isset($_REQUEST['submit'])) { $name = $_REQUEST['name']; $date=date("Y_h_m_s"); $file_get_location = $_FILES['image']['tmp_name']; $file_name = $_FILES['image']['name']; $new_filename=$date.'_'.$file_n...

PHP upload image to folder with minimum 1 MB size and file extension

It is a very easy way  to uploading image in php folder with particular location and  allowed minimum  size of image and also with  particular extension. 1. upload.php 2. create upload folder in root directory /// upload.php if(isset($_POST['submit'])) {      $fileName = $_FILES['file']['name'];    $targetDir = 'upload/';     $targetDir = $targetDir . basename($fileName);      $fileExtension = strtolower(pathinfo($targetDir, PATHINFO_EXTENSION));     $fileSize = $_FILES['file']['size'];     try {      if($fileExtension != 'jpg' && $fileExtension != 'jpeg' && $fileExtension != 'png') {            echo "sorry file format not allowed";      }      if($fileSize > 1000000) {            echo "file size not allowed more ...

Array in PHP

Types of Array in PHP An Array is assigned to be a single variable , but can hold dozens of individual piecies of information. Types of Array 1. Numeric Array 2. Associative Array 3. Multidimensional Array 1.       Numeric Array In numeric array have to create only elements, id will be automatically assign to the element. Example: <?php              $a   =   array ( "a" , "b" , "c" );   print_r ( $a ); ?> Output: Array([0]=>a [1] => b [2]=> c) 2.       Associative Array This kind array have id and elements both are created Example : <?php $a   =   array ( "1" => "a" , "2" => "b" , "3" => "c" );      print_r ( $a ); ?> Output : Array([1]=>a [2] => b [3]=> c) Note : The above out in...

How to register in php(Sign up form in php)

How to register in php(Sign up form in php) Basically in register form is register by email, mobile number, username etc. The purpose of register(sign up) to add the user in system who get the benefits of system(Application).The logic of register(sign up) is no duplicate users allowed in application with form validation.Password and Confirm password input must be same.below are steps to develop sign up (register) in the Application. Steps: 1. Create Database CREATE   TABLE  IF  NOT   EXISTS   ` users `  ( ` id `   int ( 11 )  NOT   NULL ,    ` first_name `   varchar ( 200 )  NOT   NULL ,    ` last_name `   varchar ( 200 )  NOT   NULL ,    ` email `   varchar ( 100 )  NOT   NULL ,    ` password `   varchar ( 100 )  NOT   NULL ,    ` status `   varchar ( 50 )  NOT   NULL , ...

Login, Logout and Dashboard Using PHP and with MySQL database

Login, Logout and Dashboard Using PHP and with MySQL database Steps :            1.  Create database and insert (database.php) CREATE   TABLE  IF  NOT   EXISTS   ` users `  ( ` id `   int ( 11 )  NOT   NULL ,    ` first_name `   varchar ( 200 )  NOT   NULL ,    ` last_name `   varchar ( 200 )  NOT   NULL ,    ` email `   varchar ( 100 )  NOT   NULL ,    ` password `   varchar ( 100 )  NOT   NULL ,    ` status `   varchar ( 50 )  NOT   NULL ,    ` created_at `  datetime  NOT   NULL ,    ` updated_at `  datetime  NOT   NULL ) ENGINE = InnoDB AUTO_INCREMENT =2   DEFAULT  CHARSET = latin1; -- -- Dumping data for table `users` -- INSERT   INTO   ` users `  ( ` id ` ,  ` ...