[How TO] Add php codes in Blogger's blog

PHP is considered as the most powerful computer language that makes things happen within the seconds. However, PHP is not supported by Blogger or BlogSpot running platform which makes it extremely difficult to customize and implement some new latest developments, but there are still some ways through which you can add PHP codes in your Blogger enabled Website. remember, the results are not 100%, but it is far better than not having a PHP code on your blogger site. In this article, i will show you how to add PHP codes in Blogger.



 Creating a PHP File:


firstly you have to create a PHP file in which you have all your php codes, and make sure that the file is working perfectly and file is free from errors otherwise things gone mad.Following is the simple hello world php code (only for beginners)

<?php
echo 'Hello World
';
 ?>

After creating the file with all your desired codes make sure you save it in .PHP extension. For example, cybertrickz.php, you can use NotePad++ for writing codes because it is the only FREE standard developing tool.

 Hosting a PHP File:


You all know that blogger does not allow you to host any files, Therefore you to need a host on your hosting or you can use a extraordinary fantastic medium GOOGLE drive to host your files for Free. if you don't know how to host files on GOOGLE drive then read my Detailed tutorial :

HOW TO HOST CSS OR JAVASCRIPT FILES IN BLOGGER USING GOOGLE DRIVE



Did you know everything has a alternative , so the alternative of Google drive is DROPBOX , you can also use it but Dropbox has a bandwidth problem, So i prefer GOOGLE drive.



Adding  PHP Codes in Blogger




After creating and hosting the PHP file, login into your Blogger account. Once logged in, Go  to the dashboard and select the blog on which you would like to add PHP Codes. Now it depends on your needs whether you want to add the PHP code in posts, pages, sidebar or footer. Just paste the following code anywhere you would like to display the PHP file.

<object width="600" height="500" type="text/html" data=" your-file.php"></object>

Don’t forget to replace your-file.php with the URL of your own PHP file that you may have got while hosting it on services like Google Drive Dropbox and etc.

Congratulations: You have successfully added PHP codes to blogger. Go and check your blog to see if things are working as planned. Let me know, if you have a better way of doing this job.

I hope this tutorial has helped you in learning how to add PHP codes in blogger. Still, this is not the most accurate way because we are just using a iFrame technique to include the codes. Blogger needs to think more on making its platform friendly for the developers so that they can bring creativity and awesomeness to their blogs and websites.
Enhanced by Zemanta

cybertrickz

RH HASSAN is a professional Graphic and Web Developer ,creative content writer,a Photoshop/illustrator designer and a proud perfectionist when it comes to art and design.

No comments:

Post a Comment