0
Find files inside a directory that starts with a specific string using php
Find files inside a directory that starts with a specific string using php.This script will search for files that starts with a string [Whatever you give] inside the query string.
For instance if the below script is saved inside a file say search_files.php...
Find the string and then the line number using php from text file
Find the string and then the line number using php from text file or a text data base.
In this we are searching a string named alan inside one of our log files.
$searchString = 'alan';
$URL = "logs/logs.txt_2011-08-10";
$data = file_get_contents($URL);
$data...
Display text file line by line and delete certain lines using php
Display text file or text data base line by line and delete certain lines using php. Each line of the text file is read and a DELETE link is added along with it.Grab the script here. NOTE:-My text file name is mail_list.txt
Create a file with...
Randomly read and display values of an xml file using php
This script will show you how to read and display the values of an xml file using php. My demo.xml looks like this
<message><name>Antonio Paulo/name><website>http://mistonline.in</website><comment>Good One</comment><date>1305127910</date><user_ip>2.241.68.95</user_ip><user_agent>Mozilla/5.0...
Words Validation with Javascript
Hi today i will explain you how to filter out inappropriate words from being updated or send from your website.This is simple javascript.
badwords.js
Contains javascript code. If you want add some more words in bad_words_array
var bad_words_array=new...
File System Reference In PHP
The unlink() function deletes a file.
This function returns TRUE on success, or FALSE on failure.
Syntax
unlink(filename,context)
Parameter
Description
filename
Required. Specifies the file to delete
Example
<?php
$file...
Custom Error Pages Using .htaccess
A Simple Method To Create Custom Error Pages
The first use of the .htaccess file which I will cover is custom error pages. These will allow you to have your own, personal error pages (for example when a file is not found) instead of using your...
Secure PHP Scripts
Securing your variables
In most versions of PHP, you can access the value of a variable before it is initialized. Consider this simple example:
if ($password == $the_password) {
$logged_in = 1;
}
if ($logged_in == 1) {
// secure...
Export mysql tables to excel new version using phpxls pear spreadsheet writer
Export mysql tables to excel new version using phpxls pear spreadsheet Excel Writer, This is very easy and flexible. Other techniques of creating excel sheet may work with Openoffice but will not work mostly with Microsoft excel viewer. So this...
Exclamation mark (!) at odd places while using php mail fixed
Hey guys, Today one of my reporting tool was having an issue with its mail content. The tool is suppose to give me report for the previous days management processes done by my users.
I have noticed that in the EMAIL content there were some Exclamation...
Captcha using php
This script will show how to create captcha image using php.We have captcha.php, class.simplecaptcha.php,white.png and 3 font files.
The file captcha.php contains all the settings on how to change the font , the image file etc.,
< ?php
session_start();
require_once('class.simplecaptcha.php');
/*
*****CONFIGURATION...
Find any day before a given date using php
This tutorial will help you in finding any day before a given date using simple php trick.Just look at the code below.
The script will take the server date as current day and will negate it against the number of days provided. Here i have given...
Listing the comma seperated data or line using php
This tutorial will show you how to seperate a line that contains comma, semicolon etc and then list it accordingly. Here we are using explode() and also empty(). If there is an empty space between two comma or semicolon then that is automatically...
