Category Archives: PHP

Compare two text file using php

Step1: Create two files named file1.txt and file2.txt with the following contents Apple Orange Mango Pineapple Jackfruit Step2: use the below php file to compare the two text file

Creating dropdown box using php.Dynamic dropdown box using php

Steps: create a database ‘test’. create a table inside test using the below code.

use the below php file that will show a drop down box for you

File upload using php

step1: create a database ‘test’ and create table inside this database using the following query

step2: create a folder called “fileupload” . step3: .create a folder ‘myfolder’ inside the ‘fileupload’ folder. step4: save the file ‘categories.php’ inside the ‘fileupload’ folder.

step5: save the file ‘successcategories.php ‘ inside the ‘fileupload’ folder.

step6: execute… Read More »

How to check a radio button using database content

Create a simple php page that loads the list of users information with name and sex.if value exist in the database with ‘1’ as Male and ‘0’ as Female. Please follow the following steps Step1: create a database called “test”. create a table called “tbl_user_information” using the below query

Step 2: create file called… Read More »

Replace a line of code in a php file using php

Replace a line of code in a php file using php To replace the below line of code in the testreplace.php define(‘PATH_CURRENT_SITE’, ‘/mydoubts/’); this should be changing to define(‘PATH_CURRENT_SITE’, ‘/vasanthan/’); For this please execute the stringreplace.php… changes will reflect in the testreplace.php #File-stringreplace.php

2.#File-testreplace.php

Find out the largest and smallest value in an array without using array function: using loop

Regex validation with examples using php

Simple File upload in PHP:storing file names in database

Step1: create a database called testlogin using phpmyadmin. Create a table using the following code execution through phpmyadmin query window

step2: create a folder called ‘fileupload’ and the following files under htdocs folder htdocs – fileupload step3:create a folder ‘storage’ under ‘fileupload’ folder- set permission 777 for storage folder htdocs – fileupload – storage… Read More »

Import Csv file using php and Mysql

Step1: create a database called testlogin through phpmyadmin. execute the below query through phpmyadmin

use the below files for database connectivity and csv reading and insertion db_connect.php

index.php