Innovative High Performance Web Hosting Solutions.
 Switching hosts?
Vexxhost makes switching hosts quick and easy. We'll even move your files and your databases from your old host to our servers for free.
Contact us web hosting
Happy Customers
I recently switched to vexxhost and I could not be happier! The speed, reliability, and service are far beyond any service I have ever tried. Their support team is at your assistance no matter the time with accurate and friendly responses. I have recommended all of my friends to make the switch to vexxhost, and I encourage you to do the same. I will never use another host. Thank you for the continued outstanding support!

John Zagurasky
web hosting
comodo

CodeIgniter: The Future of PHP Web Development
Posted: January 13, 2010 at 7:44 pm | No Comments

As a PHP developer since the introduction of PHP3, I always insisted on creating my scripts from scratch. I believed that starting from an empty text file was the best, fastest and most lightweight solution. This was what I have been doing for the past years until I read up more about PHP frameworks.

I was extremely skeptic about frameworks, I told myself that PHP is way too advanced already and a framework is simply overkill, that if I needed anything, I would code it myself and take care of it. I ran into CodeIgniter and I was very impressed by their “Blog in 20 minutes” video (which in all honesty can be done in 5 or 10 minutes if the video maker did not go into details). Also, it is open source and accessible to everyone.

We have recently introduced a new dedicated server configuration utility when making orders for our clients (check it out, follow this link and click on “configure server” for any other listed servers: xeon dedicated servers). We had to take care of this and obviously have it up as soon as possible. I had reviewed and checked CodeIgniter so I decided to give it a shot for this project.

Deliver much faster results
The results were incredible, the entire utility was done in less than 2 days which seems incredible for the amount of code that would have been required if I did not have a framework, there are numerous places where a lot of time was saved because of CodeIgniter.

Built in form verification was a great time saver; CodeIgniter makes it extremely easy to take care of validating web forms by using a library, verifying the input of the user is as simple as writing the following:

$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
$this->form_validation->set_rules('email', 'Email', 'required');

if ($this->form_validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
$this->load->view('formsuccess');
}

More about this is explained on CodeIgniter’s documentation regarding Form Validation. There are tons of different ways and libraries/classes that permit you to get more done in much less time.

Easily create expandable and modular PHP code
CodeIgniter is based on the common concept of “MVC” code, MVC stands for model-view-controller, the three aspects or modules of the application or script that you’re developing. Each aspect focuses on taking care of something specific, the views is basically what the client sees (you could possible call it template), but it’s basically what the client sees, the “controller” is the back-end where everything is executed and everything is programmed there, the models are basically common functions or classes that you’re using

While I tried my best explaining it, the best way to understand MVC coding is by actually giving it a shot and also referring to CodeIgniter documentation regarding the model-view-controller software approach.

Give it a shot.
The amount of time saved has made us switch over from our own code to running everything through the framework; it simply makes everything so much organized and makes modifications a swift. The amount of time saved plus the impressive software approach leaves your program to be extremely modular and easily expanded.

Thanks for reading everyone and hope you enjoyed the post :)

Resident VEXXHOST programmer,
Dave

Top 5 new (and cool!) features in PHP5 that you probably haven’t heard of
Posted: January 3, 2007 at 11:23 pm | (27) Comments

PHP5 has brought so much new features but because of its big syntax changes, a big percentage of the PHP developing base has not made the change. Here are the top 10 new features that could change your mind.

5: Better error handling with exceptions
I’m sure every PHP developer had been staring at the famous white screen with a “Syntax error” clueless at where the error is really at. With PHP5, you can actually handle PHP errors and do whatever you want with them, but that’s not all. They have also included exceptions which I’m sure most C++ or Java developers use. The good part is that instead of simply failing on with close no errors to you, you could put a few checks before and information you could need such as maybe a print_r() on an array. I have written an article about this: http://vexxhost.com/blog/?p=21

4: Completely rewritten MySQL extension
The MySQL databases are the PHP’s partner in crime. Many developers use this database system in their website’s because it is on of the easiest, free, open-source database software. However, its performance combined with PHP4 was close to poor. Introduced with PHP5 is a newer, rewritten, optimized MySQL extension which was also compatible with MySQL 5.0. It has also introduced other functions such as: Prepared statements, SSL connections, Multi-query functions.

3: A heck of a lot more useful functions
I have a few favorite PHP5 functions which speed up time while coding & enhances the website’s performance. One of my favorites is the __autoload() function – What it does that it would be called if a class that was created and did not exist. It provides you with the class name. This is useful because you don’t need to manage what includes you need for X and Y file and reduces the load for those who simply include all the classes in for every single PHP file. Also, another favorite is file_put_contents() which reduces the 6 lines of code to add something to one.

2: Finally! SQLite database support!
I’m sure a lot of developers will be happy about this one. While MySQL is very popular among most PHP developers, SQLite is much different than it. It actually uses normal files and reads them. It does not need a daemon (or called server) to run in order to execute any queries on it. It makes a better smaller database for these low traffic sites.

1: The best damn OOP support period
PHP programmers have spent an awful of long time trying to create hacks so in order that PHP can make a better OO programming language. Finally, they are rewarded with OO support that either PHP3 or PHP4 can match. It has anything you usually see in most of the other established coding languages. From Constructors, Destructors, Public, protected, private properties & methods, Interfaces, Abstract classes, Class type hints, Static properties and methods, Final properties and methods & a whole suite of magical methods.

That’s the top 5 for me. I hope you think that PHP5 deserves a try! (and we offer it with our hosting plans!)

What FFMPEG-PHP can do and how to use the most out of it
Posted: December 20, 2006 at 8:49 pm | (12) Comments

Need help using specific FFMPEG-PHP functions or some programming help? Let our experienced technicians help you debug your problem for FREE. Sign up today and post at our online community: FFMPEG-PHP Help Forums

You’ve probably heard of ffmpeg-php and it’s wide usability mostly in sites that involve with videos such as YouTube or any other similar site. Here’s a bit of an introduction to it and how to use it.

First thing, you’ve got to check that your web hosting provider actually has ffmpeg & ffmpeg-php extension installed on your account and then you could get started with ffmpeg. You can check if it’s installed by creating a PHP script and executing the following code:

extension_loaded('ffmpeg') or die("ffmpeg extension not loaded");

If you get “ffmpeg extension not loaded” then your web hosting provider does not have ffmpeg installed, if you get nothing, then you’re one the good track!

ffmpeg-php is very simple to learn, what it is pretty much is an interface that works with the ffmpeg software to make it easier for PHP developers to access.

Like any object in PHP, you’ll have to start with creating a new instance of it. You can do that by using the following line:

$ffmpegInstance = new ffmpeg_movie(“/path/to/movie/”);

Now that you’ve had that, you can use that instance to use the many features of ffmpeg-php which are from knowing the duration of the movie/audio in seconds to retrieving the bitrate of the movie/audio file.

Once here, it’s pretty much like object oriented programming, ex:
$ffmpegInstance->getDuration(); // Gets the duration in secs.
$ffmpegInstance->getVideoCodec(); // What type of compression/codec used

This can be very helpful when coding anything that has to do with uploading videos because you can know a lot of information about it. I’ve made a small script that pretty much retrieves all the information that ffmpeg can get right here

Creating PDF’s on the fly using PHP & FPDF
Posted: December 3, 2006 at 12:27 pm | (15) Comments

Generating PDF’s is an easy method to make a very nice printable and/or savable version of an article. This could be helpful in a WordPress blog or any articles website. This method utilizes the popular FPDF class.

First of all, I suggest you get the latest FPDF version from here. I suggest creating a directory such as “pdf” on your web hosting space. You will need to place the fpdf.php into that directory, you will only need it.

Let’s make our first “Hello World” example. Place the following in a file called test.php:

<?php
require('fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>

Now let’s see that code line by line…

require('fpdf.php');
This line includes our FPDF class that we need to create the PDF file.

$pdf=new FPDF();
This line creates a new instance of the FPDF class which will be binded to $pdf

$pdf->AddPage();
This line tells FPDF to add a new page to the PDF file; obviously we need one page so we will call this function once.

$pdf->SetFont('Arial','B',16);
This line tells the FPDF class to change the font to Arial, bold, 16 pt.

$pdf->Cell(40,10,'Hello World!');
This line is just like the “echo” of PHP, the text fields in PDF files are just sort of rectangles with text in them, so we want the width of 40 pt. and a height of 10 pt., the third value is the text to be written in that rectangular box.

$pdf->Output();
Our final line, which pretty much means: “we’re done, show us our PDF!”

That’s a very simple FPDF usage, however, here is a bit of more advanced version of FPDF usage:

<?php
require('fpdf.php');
$pdf=new FPDF("L", "mm", "A4");
$pdf->AddPage();
$pdf->SetFont('Arial','BIU',30);
$pdf->SetTextColor(0,0,255);
$pdf->Cell(60,20,'PDF+PHP Test',1,1,C,0);
$pdf->Output();
?>

Now let’s do a quick review of that more advanced code:

$pdf=new FPDF("L", "mm", "A4");
This will create a new instance but instead will default to creating landscape pages because of the first L, P can be used instead to default to portrait pages. The second value is the default measurement unit, a choice of point (pt), millimeter (mm), centimeter (cm) and inch (in) is given. The last value is the size of the page, the choice of A3, A4, A5, Letter & Legal is given.

$pdf->AddPage();
Simple function, just add the page, you can tell the function to create either a portrait (P) or landscape (L) by giving it as a first value (ex: $pdf->AddPage("L"), $pdf->AddPage("P")).

$pdf->SetFont('Arial','BIU',38);
This required function again says that we want an Arial, 30 mm in size (because of the default size unit), the 'BIU' simply tells that we want it to be Bold, Italic & Underlined.

$pdf->SetTextColor(0,0,255);
This sets the default text color for the text we will be writing, I’ve chosen blue here, the first value is red (r), the second is green (g) & blue (b).

$pdf->Cell(60,20,'PDF+PHP Test',0,1,C,0);
This makes the so famous rectangle with 60 mm of width & 20 mm of height, we wrote ‘PDF+PHP Test’ and the first 0 means we do not want a border. The 1 next to it means that once it’s done the cell, it will go to the beginning of the next line, if 0 is provided, then it will be to the right of it, if 2 is provided then it will go below. The C is just the alignment which is center of the text inside the box, possible values are left (L), center (C), right (R).

$pdf->Output();
Output our brand new colorful PDF file!

Thanks for reading!

About SEO
Posted: November 24, 2006 at 11:10 am | (1) Comment

If you have never heard of SEO, it’s an acronym for Search Engine Optimization and according to wikipedia.org

Search engine optimization (SEO) is a set of methods aimed at improving the ranking of a website in search engine listings, and could be considered a subset of search engine marketing. The term SEO also refers to “search engine optimizers,” an industry of consultants who carry out optimization projects on behalf of clients’ sites. Some commentators, and even some SEOs, break down methods used by practitioners into categories such as “white hat SEO” (methods generally approved by search engines, such as building content and improving site quality)

Hidden links are a great way to boost your rank on a specific keyword. They are usually in a paragraph, then the keyword would have a link to the page you’re looking to boost it’s rank, but without an underline and the same color as the text.

As an example, I’ll take SEO. I would write a paragraph in my site about SEO and a link to my SEO page, though when you’ll read the text, you won’t notice SEO as a link because it’s the exact same color. The search engines consider that no problem as it’s a link with specific keywords to a page and we all know search engines love it!

If you have any questions about this — Just post a comment and I’ll help you!

Copyright © 2005-2009 vexxhost web hosting.
All prices are in USD unless otherwise indicated.