Archive for the ‘PHP tutorials’ Category

How to hide PHP Notice & Warning Messages

How to hide PHP Notice & Warning Messages. The PHP notice errors are frustrating and you are tired of seeing them when you are working on your scripts. They are showed at the beggining of your pages and may reveal confidential information to the visitor like the path to the file or the php file [...]

Read the rest of this entry »

PHP : How to get the select values from a Drop Down list

This is the scenario
<select name=”cars”>
<option value=”volvo”>Volvo</option>
<option value=”audi”>Audi</option>
<option value=”toyota”>Toyota</option>
<option value=”form”>Ford</option>
</select>
This php code – get all everything between <select>
preg_match(’/<select name=”foo”>(.*)<\/select>/msU’,$html,$matches);
print_r($matches);

Read the rest of this entry »

How To Force File Download With PHP

Here is a a simple code that will force the browser to download a file

Read the rest of this entry »

Simple PHP BBCode

Many websites allow visitors to contribute to the sites’s content through forums, blogs etc . When you’re building such sites, it’s a good idea to provide users with the ability to enhance that content by posting formatted text. Here is a simple example of how to use bbcode with php.

Read the rest of this entry »

Validate username in php

Use this simple code to validate the usernames in php ( maybe you need to a user registration ). The username will have only characters, numbers and _ (underscore)

Read the rest of this entry »

Validate Email Address in PHP

PHP validate email script is an easy way to validate an email address. Use this quick and simple PHP regular expression for email validation.

Read the rest of this entry »

How to search for a string in txt file ?

One of our clients asked how to display the hits from his website that are stored in a txt file .
First of all we need to search for that specific link and then display the hits.

Read the rest of this entry »