How to append html code using javascript and php

append html code using javascript and php, In this example I am going to show you how to add the dynamic HTML code into Document using javascript and PHP.

How to append html code using javascript and php

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php

$random_id = 125845465; // PUTTING SOME RANDOM ID YOU CAN USE YOURSELF.

$DYNAMIC_HTML = '<div>
<b>Sponsored Links</b>

<div>
 12px;font-weight:bold;" href="http://www.ucoz.com/" rel="nofollow">Create a website for free - uCoz

Build a website quickly and easily
Customizable templates and graphics

</div>

<div>
 12px;font-weight:bold;" href="http://www.purabtech.in/files/domain_names/">$1.99 Domain Names

 With every new non-domain purchase thru <a href="http://www.purabtech.in/files/domain_names/" rel="nofollow">wordpressapi</a>, you get a domain name for only $1.99.
</div>

<div>
 12px;font-weight:bold;" href="http://www.purabtech.in/files/" rel="nofollow">FREE Hosting!

 With every domain you register with <a href="http://www.purabtech.in/files/" rel="nofollow">wordpressapi</a> you get FREE hosting.
</div>
</div>';

 $HTML = "var objHead = document.getElementsByTagName('head');
 var objCSS = objHead[0].appendChild(document.createElement('link'));
 objCSS.id = '.$random_id.';
 objCSS.rel = 'stylesheet';
 objCSS.href = 'http://YOURSITE/STYLE.css';
 objCSS.type = 'text/css';";

 $HTML .= '
 var WORDPRESAPI_html_'.$random_id.' = document.createElement("div");
 WORDPRESAPI_html_'.$random_id.'.id = "WORDPRESAPI_html_'.$random_id.'";
 WORDPRESAPI_html_'.$random_id.'.style.position = "absolute";
 WORDPRESAPI_html_'.$random_id.'.style.zIndex = "100";
 WORDPRESAPI_html_'.$random_id.'.style.left = "0px";
 WORDPRESAPI_html_'.$random_id.'.style.top = "0px";
 WORDPRESAPI_html_'.$random_id.'.style.visibility = "hidden";
 WORDPRESAPI_html_'.$random_id.'.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
 WORDPRESAPI_html_'.$random_id.'.innerHTML = "'.addcslashes($DYNAMIC_HTML,"\\\'\"&\n\r<>").'";
 document.body.appendChild(WORDPRESAPI_html_'.$random_id.');';

echo $HTML;

?>

In this code if you observe then following line is very important.

 WORDPRESAPI_html_'.$uniqid.'.innerHTML = "'.addcslashes($HTML,"\\\'\"&\n\r<>").'"; 
How to append html code using javascript and php
How to append html code using javascript and php

Whenever you are using javascript and PHP both together then use following way to push your HTML in Dom.

install php and memcached server on centos5

In this article I given full step by step installation guide about php and memcached . Check full article for install php and memcached server on centos5.

install php and memcached server on centos5

What is Memcached?

Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

install php and memcached server on centos5
install php and memcached server on centos5

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

Please use following commands for installtion;
[root@ip-192-168-2-125 wordpressapi]# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm

[root@ip-192-168-2-125 wordpressapi]# yum remove php-common

[root@ip-192-168-2-125 wordpressapi]# yum install php-pdo php-mcrypt squirrelmail php-pecl-apc php-xml php-gd php-devel php php-imap php-pgsql php-pear php-soap php-mbstring php-ldap php-mysql php-cli php-pecl-memcache

[root@ip-192-168-2-125 wordpressapi]# /etc/init.d/memcached restart
Shutting down Distributed memory caching (memcached): [ OK ]
Starting Distributed memory caching (memcached): [ OK ]

[root@ip-192-168-2-125 wordpressapi]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

[root@ip-192-168-2-125 wordpressapi]# vim /etc/php.ini
In php.ini file Please find the “extension=modulename.extension” words
Under that sentance please paste following line:
extension=memcache.so
Note: dont comments that line.

[root@ip-192-168-2-125 wordpressapi]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@ip-192-168-2-125 wordpressapi]#

CPM, CPI, PPC, CPA, CTR and ECPM in AD serving logic

Many people wondering what is CPM, CPI, PPC, CPA, CTR and ECPM concepts. As I worked on ad serving projects so I created some points these concepts. I worked in to admedia domain for some years. I worked with openx adserver technology. I am going to give you very brief ieda about CPM, CPI, PPC, CPA, CTR and ECPM logics.

CPM, CPI, PPC, CPA, CTR and ECPM in AD serving logic

First I am going to give small description and brief about same.

CPM, CPI, PPC, CPA, CTR and ECPM in AD serving logic
CPM, CPI, PPC, CPA, CTR and ECPM in AD serving logic

CPM – Cost per thousand
CPI – Cost Per Impression
PPC – Pay per click
CPA – Cost Per Action
CTR – Click-through rate
ad serving
Click fraud
Cost Per Click
View-through rate
Clicktag

Breif description is helpful for common people as well as developers.

Impression – Per Page Views( per Page loads)
Click – Per ad click
CTR (Click through rate)
Click-through rate or CTR is a way of measuring the success of an online advertising campaign. A CTR is obtained by dividing the “number of users who clicked on an ad” on a web page by the “number of times the ad was delivered” (impressions).

Formulae:
CTR (%) = (Clicks/Impressions)*100

For example, if a banner ad was delivered 100 times (impressions delivered) and one person clicked on it (clicks recorded), then the resulting CTR would be 1 percent.
CTR (%) = (1/100)*100 = 1%

CPM (Cost Per Thousand Impressions)
The CPM model refers to advertising bought on the basis of impression.
The total price paid in a CPM deal is calculated by multiplying the CPM rate by the number of CPM units.

Formulae:
CPM unit = (Impressions/1000)
Total Price ($) = CPM unit * CPM rate ($)
Per Impression cost ($)= CPM rate ($) / 1000

For example, one million impressions at $10 CPM equals a $10,000 total price.
1,000,000 / 1,000 = 1,000 units
1,000 units X $10 CPM = $10,000 total price

The amount paid per impression is calculated by dividing the CPM by 1000. For example, a $10 CPM equals $.01 per impression.
$10 CPM / 1000 impressions = $0.01 per impression

ECPM (Effective Cost Per Thousand Impressions)
eCPM is calculated by dividing total earnings by total number of impressions in thousands.
It is a great performance measure for your various ad units, so when experimenting, you can use eCPM to compare your results.
Even for smaller sites, eCPM can be a useful statistic to track ad performance.

Formulae:
eCPM = (Total Earnings / Impressions) * 1000
Note : In openx total earnings refers to Rev (Revenue) in statistics

For example, eCPM for 370 page impressions and $1.48 total earnings will be :
eCPM = (Total Earnings / Impressions) * 1000
= ($1.48 / 370 ) * 1000
= $4.00

Reading this article, I think you will be able to catch the CPM, CPI, PPC, CPA, CTR and ECPM concepts

Google’s is creating the Buzz more secure in few more days

On Saturday, the company announced it would change Buzz again, not with regard to profiles (which will apparently continue to be made public, if only to other Buzz users, by default) but rather, followers. As Buzz product manager Todd Jackson wrote, “Starting this week, instead of an auto-follow model in which Buzz automatically sets you up to follow the people you email and chat with most, we’re moving to an auto-suggest model. You won’t be set up to follow anyone until you have reviewed the suggestions and clicked ‘Follow selected people and start using Buzz.'”
GoogleBuzzLogo68
Also over the weekend, Google essentially admitted it was not the best of ideas to assume that items already shared through Picasa and Google Reader, on a local basis, should become automatically shared through Buzz; new users were discovering they were already sharing Picasa photos without ever having given their permission. What we have also yet to see next week is whether Buzz users can still make use of a trick that a security engineer discovered last Friday, to use Picasa to ascertain one’s semi-public Google Profile URL as though it were a fully public one.

A Google spokesperson confirmed to Betanews this afternoon that a second round of privacy changes, the nature of which was revealed last Saturday evening, is still being developed, and may yet go live “in the next couple of days.”

Source Link

how to create rounded corners using css

CSS tutorial, how to create rounded corners using css. We always need the rounded corners for our various web projects. W3C has offered borders in CSS3.

W3C has offered some new options for borders in CSS3, of which one is border-radius. Both Mozila/Firefox and Safari 3 have implemented this function.

how to create rounded corners using css

There are many javascripts are available to create the rounded corner using scripts. But specially recommend use pur css to avoid unnecessary script loading. So many sites uses the background image also, We need to avoid that also.

Following css will give you the rounded corners using only css:

.main_container {background:#ccc; color:#fff; margin:0 15px;}
.wordpressapitop, .wordpressapibottom{
display:block;
background:#fff;
}
.wordpressapitop *, .wordpressapibottom *{
display: block;
height: 1px;
overflow: hidden;
background:#ccc;
}
.wordpressapi1{margin: 0 5px}
.wordpressapi2{margin: 0 3px}
.wordpressapi3{margin: 0 2px}
.wordpressapi4{
margin: 0 1px;
height: 2px
}

Use following code in your html file and you are able to use rounded corners without using the javascript

round-code

How to create rounded corner using css
How to create rounded corner using css

Above script will work on all browsers FF, Chrome, Safari, IE6, IE7, IE8.

Free WordPress Video Tutorials for Beginner and experts

WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time.

Free WordPress Video Tutorials for Beginner and experts

WordPress is growing very rapidly because of SEO friendly URL and best admin features… free plugins and themes… There are so many companies are working on only wordpress. There are so many new developers and designers want to jump in wordpress world. So many big and small firm are asking bout wordpress custom development.

In this post I am going to write about few nice wordpress video tutorials:

WordPress Training

Free WordPress Video Tutorials for Beginner
Free WordPress Video Tutorials for Beginner

Training Index

This is an index of the core WordPress training videos grouped by functional area.

Blogging with WordPress

Configuring WordPress

Customizing WordPress

Installation and Upgrades

WordPress Administration

killersites (I specially recommend this site for learning the wordpress)

Free WordPress video tutorials for beginners - Killersites.com_1266309046001
Free WordPress Video Tutorials for Beginner

This 12 video course, takes someone with just beginners HTML and CSS skills, through the steps needed to build a WordPress template from scratch.

Check out our WordPress Themes Tutorial now.

css-tricks.com

Free WordPress Video Tutorials for Beginner
Free WordPress Video Tutorials for Beginner

Part One: Download, Install, “Reset” Theme

Video Page
Direct Video Download (.mov)

Part Two: Structure

Video Page
Direct Video Download (.mov)

Part 3: Finishing Touches, Extra Stuff

Video Page
Direct Video Download (.mov)

ithemes.com

Free WordPress Video Tutorials for Beginner
Free WordPress Video Tutorials for Beginner

GENERAL ITHEMES TUTORIALS

NEW! WORDPRESS 2.8 TUTORIALS

WORDPRESS 2.7-8 TUTORIALS

iTHEMES THEME TUTORIALS

  • First Steps – Installing WP and activating your theme
  • How to change Featured Images (Rotating photos feature)
  • How to adding/removing Page items to your menu navigation (Menu Builder)
  • How to set Contact Form Page Template (if applicable)
  • How/where to include your Google Analytics or statistics tracking code
  • Basic Search Engine Optimization tips
  • How to use Billboard ad plugin

NEW! 7 STEPS TO OPTIMIZING WORDPRESS

  1. Change your permalinks structure
  2. Install these plugins
  3. Include your main keywords in your title bar
  4. Put in your meta tags
  5. Paste your email newsletter form code here
  6. Write good headlines for search engines
  7. Study your traffic stats to refine your strategy

THEME TUTORIALS

NEW! ADDINGTON THEME (Theme Demo)

NEW! JENKS THEME (Theme Demo)

iCOMPANY THEME (Theme demo)

ECOMMERCE THEME (Theme demo)

ESSENCE THEME (Theme demo)

You can find the wordpress tutorials on Vimeo.com and youtube.com also.. the huge number of videos you can find on Vimeo.com..

how to create background image online

For many websites and projects we need the custom backgrounds. We need unique and good designed background. Main think is we need to like that background. There is easiest solution I would recommend.

how to create background image online

We should go for online background generator.  I searched on for online background maker and I found couple of good online software. Which are really unique and create the backgrounds as per our choice. As web designer and developer we always need to choose best backgrounds.

Here I am going to list some of good online background maker.

Background Image Maker

how to create background image online
how to create background image online

COLOURlovers

COLOURlovers -- Add a Pattern_1266306875323

Dotted Background Generator

Dotted Background Generator_1266307118594

stripemania

Stripemania - Striped background generator_1266307426005

I found above sites are very easy to create the backgrounds..

free desktop software for wordpress bloggers

WordPress is so powerful and popular in these days because of SEO friendly behavior. I love to write a blogs. Many times I got issue with writing blogs with browsers. So I was searching for good tool that has desktop application features and as well as that will connect to my blog.

free desktop software for wordpress bloggers

I got so many trial and paid desktop softwares but I was looking for specially free tool.

In this post I am going to share the best and easy but still free desktop software for wordpress bloggers.

Zoundry (Free for Download)

free desktop software for wordpress bloggers
free desktop software for wordpress bloggers

Description: This software is excellent! This is what I had in mind when I set out to find desktop blogging software for wordpress. The usability is excellent. Initially, I expected some type of configuration wizard or walk-through. Instead, what I received was a panel that had the steps with links on how to set up my blog for Zoundry lovin’. I believe it worked better than a walk-through could have, since it taught me the way to set up another blog if I needed it. This app got out of my way and let me do what I set out to do. Zoundry was definitely built by a programmer with excellent usability experience.

Advantages:

  • Automatic blog-type discovery (just provide the URL!)
  • Easy to set up accounts
  • Imports your blog posts
  • Getting started tab guides you through blog set up
  • HTML validator built into the code view (big plus)
  • WYSIWYG features still usable in code view
  • Includes a publish menu to finalize your decisions, tags, trackbacks, etc.

WBloggar
(Free for Download)

free desktop software for wordpress bloggers
free desktop software for wordpress bloggers

Summary: W.Bloggar is great… I almost want to stop testing. This tool is extremely good at what it does. It does everything I was looking for, and has no extra useless features. Pinging Technorati (and other ping services) is a nice plus, something Zoundry also did. This one edges out Zoundry with it’s clean and intuitive interface.

Advantages:

  • The software seems extremely well put together
  • Walk-through on intro
  • Clean interface

1000+ free best and beautiful twitter icons for your website

Twitter is basically a simple social networking site and growing very fast. we have collected the nice collection of 1000+ free best and beautiful twitter icons for your website

free best and beautiful twitter icons

You can think of it as a hybrid of email, instant messaging and sms messaging all rolled into one neat and simple package.

In this post I am going to list the best and beautiful twitter icons for your website.

30 Free Vector Twitter Buttons Download

siah-design

Twitter Icon

twitter-icon

Free Twitter Graphics

twitter-randa-clay

Twitter Icons with Attitude

twitter3

Web 2.0rigami

Web-2.0rigami

Feed & Twitter Monster Icons

monsterfeeds

53 Brand New Twitter Icons

53 Brand New Twitter Icons

Adiumy Twitter

Adiumy Twitter

TWEETA A Free Twitter Icon Set

TWEETA A Free Twitter Icon Set

TwitterJoy icons

TwitterJoy icons

Custom Twitter Icon TwittART

Custom Twitter Icon TwittART

Birdies: A Free Twitter Icon Set

Birdies A Free Twitter Icon Set

Follow Me…Twitter Icon

Follow Me…Twitter Icon

Free Twitter Eggs

Free Twitter Eggs

Friday Freebies: Flavours Icon Set And Cute Tweeters Icon Set

Friday Freebies- Flavours Icon Set And Cute Tweeters Icon Set

Free Twitter Bottle Cap Icons

Free Twitter Bottle Cap Icons

Twitter

Twitter

22 different and unique custom twitter icons22 different and unique custom twitter icons

Animated Twitter-Bird icons

Animated Twitter-Bird icons

50 Free and Exclusive Twitter Icons

50 Free and Exclusive Twitter Icons

Sprtstwtr Icons

Sprtstwtr Icons

Some best WordPress Hacks for theme developer

there are many wordpress theme deverlopers who are looking for wordpress hacks for theme developer. we have best collection of wordpress hacks for theme developer. Some best WordPress Hacks for theme developer.

wordpress hacks for theme developer

 wordpress hacks for theme developer
wordpress hacks for theme developer

WordPress themes market has grown incredibly. Due to lot of amazing new functionality an synchronization with all social sites.

1. Create TinyURLs with your wordpress site
Open your single.php file and paste the following in the loop:


<?php
echo 'Tiny Url for this post: <a href="'.bloginfo('siteurl').'?p=.'$post->ID.'">'.bloginfo('siteurl').'?p=.'$post->ID.'</a>'
?>

2. Use The Loop To Create An “Archive” Page Template

Create the php page called archive.php and create archive page through wordpress admin and select the archive page template from sidebar option.

In archive.php file you can following code:

<?php
/*
Template Name: Archives
*/
?>

<?php get_header(); ?>

<h2><?php $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");
if (0 < $numposts) $numposts = number_format($numposts); ?>
<h2><?php echo $numposts.' recipes published since October 06, 2008'; ?>
</h2>

<ul id="archive-list">
<?php
$myposts = get_posts('numberposts=-1&');
foreach($myposts as $post) : ?>
<li><?php the_time('m/d/y') ?>: <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

3. Create A “Share the article with Facebook” Button
Use the following code in your loop where you want show the facebook share button.

<a href="http://www.facebook.com/sharer.php?u=<?php get_permalink();?>&t=<?php the_title(); ?>" target="blank">Share on Facebook</a>

4. Use More Than One Loop On A Page, Without Printing Duplicate Posts

If you want to use two query post in page or post. you can use following code:

<?php
query_posts('showposts=8');
$ids = array();
while (have_posts()) : the_post();
$ids[] = get_the_ID();
the_title();
the_content();
endwhile;
?>

<?php
query_posts(array('post__not_in' => $ids));
while (have_posts()) : the_post();
the_title();
the_content();
endwhile;
?>

5. Insert Ads After The First Post
If you want show the ad after first post then use the following code:

<?php if (have_posts()) : ?>
<?php $count = 0; ?>
<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>
<?php if ($count == 2) : ?>
//Paste your ad code here
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<?php else : ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>

There are so many wordpress tricks and hack you can found in this website. Search more.