It Stuff : Cheap Web Hosting


Hello,

In a recent post of mine I have been talking with you visitors about php hosting technology. Now it’s time to guide you finding cheap web hosting on the internet. Firstly of all, what you should do is to go to big G and search for cheap web hosting. Step two its of course note the features included and the most important : price! After that, do not start buying instantly untill you go to a web hosting review websites : it’s a good guide for you to hear other peoples opinions about a specific webhosting company before buying, you might find very precious informations which you’ll might not find on the company’s website. Reviews like those two lunarpages, startlogic for example, will make you or at least help you to make the best decision.

My tip : If I were to choose between a huge space but bad support and a cheap web hosting with little space but excellent customer support, I would choose the last mentioned one without needing a lot of time to take it!

Good luck!

Posted in It Stuff | Tagged | 10 Comments

PHP Tutorial : Read file with php

Reading the contents of a file with php is made via read php fread() function. Additionally we need to use other to functions for opening the file called fopen() and to close it with fclose(). PS : the f from the front of the functions comes from File. Here is an example of usage :

<?php
$textFiletoRead = "readFromThis.txt";
$openTheFile = fopen($textFileToRead, 'r');
$sizeOf = filesize($textFiletoRead);
$textContentsInFile = fread($openTheFile, $sizeOf);

fcolse($textContentsInFile);
print $textContentsInFile;
?>
Posted in Basic PHP | Tagged , , , , , , , | Leave a comment

PHP Tutorial : Writing your own custom functions

Errrr,

I dont know which hello word to say for this post to keep the “unique” style so will start explaining how you can do it. Firstly, you have red about a lot of “ready made” php functions which comes with the language. Now it’s time to create your own functions with your own name (must be different than existent funtions, start with a char not a number, etc etc). How you do it? Simple, by declaring its name, Look:

<?php
function myFirstOne() {

print "what to do?";
}
//and appeal it - will show the message


myFirstOne();
?>
Posted in Basic PHP | Tagged , , , , , | Leave a comment

PHP Tutorial : Parse/split url and get components

Hello folks,
My question is : how do you split and get an URL to get his components? If you’re using all kind of functions, regular expressions or whatever, here is the save and original function you’ll need and it’ll do your job : parse_url() php function. Look how simple is:

<?php
$url = "http://www.crivionweb.com/phpblog/";
print_r(parse_url($url));
?>
Posted in Basic PHP | Tagged , , , | Leave a comment

PHP Tutorial : Parse english time into unix timestamp

hello,
Sometime I discovered a very “pretty” php function which parses about any english date/time into unix timestamp. I used it to calculate dates, like adding 1 more day to a date or 1 year who cares. Also, I used to merge it back into “normal” format like dd.mm.yyyy

<?php
//isn't it simple ?
$oneyear = strtotime("+1 year");
$oneday = strtotime("+1 day");
//merge those into normal date format
$oneyear = date("d.m.Y", $oneyear);
print $oneyear;
$oneday = date("d.m.Y", $oneday);
print $oneday;
?>
Posted in Basic PHP | Tagged , , , , | Leave a comment

PHP Tutorial : Detect visitor country by ip address

Well, well, well,
It seems a “global” interests in this php script to detect visitors country, so, I decided to write a guide on how you could get it done.
There is a free solution to detect visitors country by ip address, called maxmind geoip which you can see and get here http://www.maxmind.com/app/geolitecountry
Whats needed? Download the CSV file, then import it via PhpMyAdmin application or simple mysql console into a new database.
After that, you can use it to do simple queries to detect a country via an ip address. You can see examples on maxmind’s website too.

Posted in Usefull PHP | Tagged , , , , , , , | Leave a comment

PHP Tutorial : Secured encrypted passwords

Are you searching for a way to encrypt and secure a password or just a simple phrase? If the answer is yes, in php exists a lot of functions which does that, but the most popular is md5() encrypting function. It simply cant be decrypted.

<?php
$password = "mypass";
$password = md5($password);
?>
Posted in Basic PHP | Tagged , , , , , , | Leave a comment

PHP Hosting Technology

Do you need to know about the requirements of hosting a php script, website or simple file ?

In these current days every webhosting company has this php script hosting feature included, but let me explain how it works.

PHP (Hypertext Preprocessor) is a web based server-side programming language. The php server is an engine installed on different servers like Unix, Linux, FreeBSD or Microsoft Windows. To be able to execute php websites, pages, scripts on a server, that specific “remote machine” must have the php interpretor installed.

The PHP engine is Open Source, which makes it very popular and accessible to everyone. On the other side, the “client side” one, you need to tell to the engine that he needs to parse that php page. How? Usually having .php extension rather than .html and using the <?php opening and ending ?> tags (or in shorter version like <? ?>).

Also, in most of the cases on the website hosting server you will find a MySQL engine (an OpenSource database engine), used for building along with PHP dynamic database driven websites (for example : classifieds sites, discussion boards – forums -, content management systems, etc.).

That’s all you need to know about php hosting required technology!

Posted in It Stuff | Tagged , , , , , | Leave a comment

PHP Tutorial : Explode function to split words

Have you faced with a situation where you needed to split some words ? For that exists explode() php function. Look how it works :

<?php
$words = "some words needed to split";
$wordsarray = explode(" ", $words);
print_r($wordsarray);
?>
Posted in Basic PHP | Tagged , , , , , | Leave a comment