Connect Your Websites with PHP Widgets
In this lesson, you will learn how to Develop your very first PHP widget. PHP widgets work very much like JavaScript widgets from visitor's perspective. Your internet site guests will not be ready to Enlighten the big difference in between a JavaScript widget and a PHP widget each doing the same actions. In this lesson, we will use the Guest Blogger's Badge as an example.
Step 1: Get your HTML code ready
In this case, the HTML code for the Guest Blogger's widget is:
<a href="http://www.blogging-career.com" title="Blogging as a Career"><img src="http://www.blogging-career.com/bc-guestbloggerbadge.gif" border="0"</a>
Step 2: transform your HTML code and change all the " with \" to make it PHP compatible
Original Code:
<a href="http://www.blogging-career.com" title="Blogging as a Career"><img src="http://www.blogging-career.com/bc-guestbloggerbadge.gif" border="0"</a>
PHP in a position Code:
<a href=\"http://www.blogging-career.com\" title=\"Blogging as a Career\"><img src=\"http://www.blogging-career.com/bc-guestbloggerbadge.gif\" border=\"0\"</a>
Step 3: available a new text record and copy &.amp.amp. paste the up coming code into it
<?php
$WidgetName equals "WidgetCode";
echo "document.write('$WidgetName')";
?>
WidgetName is just a Diverse which can really be renamed into anything. Let's make it "badge" for our example.
WidgetCode is where you will substitute it with your PHP prepared code.
Step 4: change the neccessary codes and conserve the widget PHP file
Finalized PHP record looks like this:
<?php
$badge equals "<a href="http://www.blogging-career.com" title="Blogging as a Career"><img src="http://www.blogging-career.com/bc-guestbloggerbadge.gif" border="0"</a>";
echo "document.write('$badge')";
?>
We will preserve the text file as "bc-guestbloggerbadge.php"
Step 5: Submit the widget PHP statement to your website
Step 6: copy and Paste your widget fetch code to your websites
Your widget fetch code looks quite equivalent to the fetch code of a JavaScript widget. In our example, it will Seem like this:
<script type="text/javascript" src="http://www.blogging-career.com/bc-guestbloggerbadge.php"></script>
You're done! As soon as you make an update to your widget PHP file, all your niche sites will see the changes as extended as they all use the same widget fetch code.
- Social Media Networks, Social Media Marketing
- WordPress Blogging Platform
- Article Submission
- Capture More with Niche Websites
- Blogs and Forums Commenting
- How to Write Good Post Titles
- Make Money on your Blogs with Advertising Networks
- Designing Your Blog Layout
- Connect Your Websites with PHP Widgets
- Tips to Enhance Your Blog Posts
Enable Commentluv | This site uses KeywordLuv