Some of you might be knowing that there is a functionality in MySQL database for storing files and retrieving the same. This is mainly used when we need to reduce response time for retrieving and using files in our application. I am listing here the method for inserting image file in and retrieving image file […]
Tag: PHP
Everything related to PHP.
Mail in PHP
I am listing here the method for sending mail using PHP code. This will be useful in many ways, for example when you want to sent mail after say a form is submitted. Note: This may work in local , but I am suggesting you to execute on live server.
Extracting String
This is small but very useful script. I have shown example for extracting only ‘src’ value from the ‘img’ tag, but you can modify and use as per your requirement using ‘preg_match_all’ function. Output will be ‘http://www.somesite.com/abc.jpg’
Page Redirect
I have written a script for getting the files list from directory and redirecting the page on selecting option from the select box. So you will get the script for fetching all the files from current directory and redirecting page on selection.
Database Backup
I am listing here the PHP script to generate backup of database. For saving the file with ‘sql’ extension replace the code as specified below at specified line numbers in the above code (Although ‘zip’ file will take less space). You can also set cron jobs for dumping databdase in the cpanel of your site. […]
Get IP Address in PHP
Many times we need the IP Address of the User visiting our website in our Application. I am listing here the method to get the User IP Address, hope it might be useful to many of you.
Assign PHP Array to Javascript Array
I am describing here a very useful method for getting the values of a PHP array in JavaScript. For this we need to assign the PHP array values to a array in JavaScript.
Copy Directory
I am listing here the method to copy full Directories with all sub-directories and files.
Display numeric in words
I hope this script will be very useful to all of you who are working in PHP. Actually this is a kind of small and useful project. I was asked to develop a script for displaying sum total in words in one of my interviews, at that time I could not complete this script. So […]
encode and decode string with base64
Many use encoding and decoding on daily basis including me, so once I made a simple script for encoding and decoding the input string with base64. base64.txt Instruction: 1) Download the file and save the text file as PHP file. 2) Place the file in your root directory. 3) Execute the file from browser. 4) […]