December 2008

Lunarpages Winter promotion.

Lunarpages has extended their promotion. $4.95/month for 12 months and 24 months plan !!

What is included in this plan.

  • Unlimited web space.
  • Unlimited bandwidth.
  • Unlimited email accounts.
  • Unlimited add-on domain
  • Host unlimited domains/websites.
  • FREE domain forever.
  • Linux / Windows plan (additional charge)
  • Choice of Apache 1.2x or Apache 2.0 at no extra charge.
  • Choice of PHP4/PHP5
  • MySQL 5.x
  • Unlimited MySQL databases.
  • Fantastico script installer. Over 50 popular one click script installer.
  • Award winning Control Panel, CPANEL.
  • Includes $775 in bonus services and software.
  • Click here to get the latest deal.
About author : This original article is property of Top 10 Web Hosting (http://www.top10webhosting.com). List of best web hosting services company offering PHP and MySQL. Compare & save ! on web hosting fee.

Note : Please include author information if you wish to republish this article.

PHP Regular Expression tool.

I was trying to create a php code to parse some text and to process it.

I have difficult time with the substr (sub string), strpos (which return the position of a particular segment of string). Testing and debugging it is just a time consuming work.

Luckily my friend enlighten me by introducing me regular expression way to look for values in a text. Using regular expressions you can easy find a pattern in a string and/or replace it if you want.

BUT PHP regular expressions seems to be a quite complicated area especially when I am not a experienced Unix user.Historically regular expressions were originally designed to help working with strings under Unix systems.

The regular expressions basic syntax

To use regular expressions first you need to learn the syntax of the patterns. We can group the characters inside a pattern like this:

  • Normal characters which match themselves like hello
  • Start and end indicators as ^ and $
  • Count indicators like +,*,?
  • Logical operator like |
  • Grouping with {},(),[]

An example pattern to check valid emails looks like this:

Code:
^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$ The code to check the email using Perl compatible regular expression looks like this:
  1. $pattern = “/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/”;
  2. $email = “abcd@mydomain.com”;
  3. if (preg_match($pattern,$email)) echo “Match”;
  4. else echo “Not match”;
The syntax is not easy derive when you are not familiar with it. After googling around, I found http://regex.larsolavtorvik.com
This AJAX tool allows you to enter sample text string and your pattern string. The tool is able to execute it on the fly and shows result immediately. It will also print out the PHP source code. This really save my time from hard coding pattern and test string.

About author : This original article is property of Top 10 Web Hosting (http://www.top10webhosting.com). List of best web hosting services company offering PHP and MySQL. Compare & save ! on web hosting fee.

Note : Please include author information if you wish to republish this article.

Free Facebook Application hosting.

I have just applied a  Facebook developer account, during the registration process, I have been offered a free hosting service – joyent.com.

The free hosting account has everything pre-installed and configured for various programming language, e.g. PHP, Python and Rail.

You will receive an email with the login information like Webmin, a pretty primitive control panel, your own Apache, MySQL ,SSH, sFTP and mail.

The free service runs on Solaris, 2 Quad-Core Intel© Xeon© processors, un-metered bandwidth*, 1/32 of CPU usage. 512MB ram and 10GB space.

I am still very new to Facebook application development, meanwhile, checkout

see also : http://wiki.joyent.com/facebook:kb:start , http://www.joyent.com/partners/facebook/

About author : This original article is property of Top 10 Web Hosting (http://www.top10webhosting.com). List of best web hosting services company offering PHP and MySQL. Compare & save ! on web hosting fee.

Note : Please include author information if you wish to republish this article.