button
Google Custom Search
 

PHP and your Godaddy hosted website

Let's face it, getting help from the "support department" of your web hosting company leaves a whole lot to be desired. It would be nice if they would just admit that they don't know what your talking about rather than offer lame excuses.

It seems to me that if a company is going to offer a product that they should know how to make it work. But, I digress, so I'll get on with it before you pull out the rest of your hair.

The first thing that you need to do is remove this line from the page you are going to use <?php include(""); ?>

Remove this from your page: <?xml version="1.0" encoding="iso-8859-1"?> or you will get a parsing error and the <?php include(""); ?> will not work. This is usually located at the top of your page above the head section. Your page may not have this line. Yipeee! Now move on.

Next, you need to create a folder and name it php include. Don't argue, just do it. This is where you will store all the files that you want to include in your web site. The files stored in your php include folder should have a .php extension. That means that the files should end with .php instead of .html or .txt and so on.

The magic bullet

Now you need to create a .htaccess file. Open notepad and paste this directive into the page
AddHandler x-httpd-php .html .htm .cgi .php
save the file as .htaccess and close notepad. The file should look exactly like this .htaccess

Upload the php include folder and the .htaccess file to the root directory of your web site. Make sure both files are in the same directory. You should now be good to go!

The syntax in your pages should look like this <?php include ("phpinclude/yourfile.php"); ?>

Happy phpeeing.

go to the next terrific page To add a title to your web page

Welcome to Pro-dezign Web Essentials, your IP address is: 38.103.63.17 and you came from: Page was directly requested

 

xhtml 1.0 strict