why wordpress was down for 110 minutes

On 19th Feb 2010 we all faced the wordpress down and that affected the 10.2 million blogs. why wordpress was down for some time on 19th 2010 due to huge amount traffic.

That is really huge amount of blogs and page views missed by wordpress. On that day itself Matt who is founder of wordpress is came up with reason. That is really great relief and news to all bloggers of wordpress.

why wordpress was down
why wordpress was down

As Per Matt:  It appears an unscheduled change to a core router by one of our datacenter providers messed up our network in a way we haven’t experienced before, and broke the site. It also broke all the mechanisms for failover between our locations in San Antonio and Chicago. All of your data was safe and secure, we just couldn’t serve it.

What we’re doing: We need to dig deeper and find out exactly what happened, why, and how to recover more gracefully next time and isolate problems like this so they don’t affect our other locations.

I will update this post as we find out more, and have a more concrete plan for the future.

I know this sucked for you guys as much as it did for us — the entire team was on pins and needles trying to get your blogs back as soon as possible. I hope it will be much longer than four years before we face a problem like this again.

how to use soap with php

SOAP is a best technology that can help you in developing web services and amazing applications. Here in this article how you can use the soap with php. You need code in defensive style always and always add the null check and try catch in code. soap is very useful and safe to use for cros domain communication.

how to use soap with php

Many times we heard about soap but we really don’t know about what is soap.

What is soap?

SOAP, the Simple Object Access Protocol, is the powerhouse of web services. It’s a highly adaptable, object-oriented protocol that exists in over 80 implementations on every popular platform, including AppleScript, JavaScript, and Cocoa. It provides a flexible communication layer between applications, regardless of platform and location. As long as they both speak SOAP, a PHP-based web application can ask a C++ database application on another continent to look up the price of a book and have the answer right away. Another Internet Developer article shows how to use SOAP with AppleScript and Perl.

If you want to use the soap then you need to install libxml on your server. In your PHP.ini file

you need to check following setting are available or not if not then put it.

soap.wsdl_cache_enabled 1 PHP_INI_ALL
soap.wsdl_cache_dir /tmp PHP_INI_ALL
soap.wsdl_cache_ttl 86400 PHP_INI_ALL
soap.wsdl_cache 1 PHP_INI_ALL
soap.wsdl_cache_limit 5 PHP_INI_ALL

SOAP is an XML-based web service protocol. The most common external specifications used by a SOAP-based service is WSDL to describe its available services, and that, in turn, usually relies on XML Schema Data (XSD) to describe its data types. In order to “know” SOAP, it would be extremely useful to have some knowledge of WSDL and XSD. This will allow one to figure out how to use the majority of SOAP services.

Here is the basic WSDL Structure



 
 …
 
 
 …
 
 
 …
 
 
 …
 
 

Filled example:

 
 
 
 
 
 
 
 
 
 
 
 
 

Soap is nothing but xml format web service to talk with cross domain servers. There are other ways also to create web services. XML-RPC is good one and that is not too much hard to learn also. Use can use following code in your PHP file.

[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]


// create a soap object
 $Soap_Object = new SoapClient("http://anywebsite.com/any.wsdl", array('trace' => true));

 // setting params to authenticate to web service
 $params_Authenticate = array('username' => 'username', 'password' => 'password');

 // authenticate to web service
 $do_login=  $Soap_Object->login($params_Authenticate);

 // take sesstion id from anywebsite.com
 $your_session_id= $do_login->loginReturn->sessionId;

 // Set the query parameters.

 $soap_query = 'select book_id from Time where book = 52435455';
 paramsQry = array('queryString' => $soap_query);

 // Make a soap call.
 $objResponse = $Soap_Object->query(paramsQry);

 header('Content-Type: text/xml; ');
 print($Soap_Object->__getLastRequest());

[/viral-lock]
Soap is nothing but a web service with xml so use PHP functions to create the Soap service. Following graph will help you to understand more and in detail about SOAP.

how to use soap with php
how to use soap with php

how to send email using php – Using PHPmailer

Many PHP programmers facing this issue and hitting same wall. Here in article we shown, how to send email using php. we given code sample with phpmailer.

how to send email using php

how to send email using php - PHP tutorial
how to send email using php – PHP tutorial

PHP itself provides the mail() function to send emails. In this article I will show you the options of sending email using PHP language.

If you are using linux or windows hosting service for running the PHP application. PHP mail() function uses the sendmail mail server to send emails.
If sendmail mail server is configured and running on linux server then only mail() function is able to send the emails.

First we will talk about mail() function. You can pass the following parameters to mail function.

mail(to,subject,message,headers,parameters)

Sample code as follows:

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
$to = "support@purabtech.in/files/, wordpressapi@gmail.com";
$subject = "Test mail";
$message = "This is a simple email message.
 this is seond line.";
$from = "some@example.com, wordpressapi@gmail.com";

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $from";

$headers .= 'Cc: test@test1.com' . "\r\n";
$headers .= 'Bcc: test2@test1.com' . "\r\n";

mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>

If sendmail mail server is not configured on your server, mostly with windows server then there is issue.
But you can send email using anothere PHP programm called PHPmailer.
you can download the PHPmailer from following URL:

http://sourceforge.net/projects/phpmailer/

Download first PHPmailer and extract the phpmailer folder and in that folder you will find the following three files.
1. class.phpmailer.php
2. class.pop3.php
3. class.smtp.php

copy and paste the following files to your PHP application. and use the following code in case of use POP email

<?php
function sendmail_wordpressapi($to,$from,$subject,$body,$id){
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
include_once('class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail             = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = "purabtech.in/files/"; // SMTP server
$mail->From       = $from;
$mail->FromName   = $from;
$mail->Subject    = $subject;
$mail->Body       = $body;
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap   = 50; // set word wrap
$mail->MsgHTML($body);
$mail->AddAddress($to, $to);

if(!$mail->Send()) {
$mail             = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
$mail->Username   = "WORDPRESSAPI@gmail.com";  // GMAIL username
$mail->Password   = "YOURPASSWORD";            // GMAIL password
$mail->AddReplyTo("smtp.production@gmail.com","wordpressapi");
$mail->From       = "support@purabtech.in/files/";
$mail->FromName   = "SMTP EMAIL-wordpressapi";
$mail->Subject    = "email server is having some issue";
$mail->Body       = "Hi,<br>email server is having some issue,<br> check this out";                      //HTML Body
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap   = 50; // set word wrap
$mail->MsgHTML($body);
$mail->AddAddress("support@purabtech.in/files/", "support-wordpressapi");
$mail->IsHTML(true); // send as HTML
$mail->Send();

} else {
 echo "Message sent!";
}
}
?>

I created above function in this function I am using SMTP mail function for sending email but in case mail is not going using SMTP details.
you can also send emails using your gmail account details. you can edit or use this function as your requirement.

You can pass following parameters to sendmail_wordpressapi function:

sendmail_wordpressapi($to,$from,$subject,$body,$id);

You can send email to multiple email addresses. I am sure using above code sending emails through PHP is very easy. If you have any quries..write to me.

How to use document.write and innerhtml

document.write and innerhtml both the functions are useful to adding the dynamic content in in Document.

Both function are many times used by developer in javascript functions, Ajax calls, Web services and many JS libraries.

How to use document.write and innerhtml

So We need understand the similarities and differences and limitation about document.write and innerhtml.

First whenever and where you calls document.write function that more important.

Here I am going to show you how to use the document.write first.

<script type="text/javascript">

var hello_world = function() {
document.write('Wordpressapi is good website'); // print hello world in DOM

var mytext = "Wordpressapi is best website";
document.write(mytext); // print again through variable.

}
</script>

Using above code you can print or execute the so much HTML content in DOM.

Here I am going to show you how to use the innerHTML in DOM.

<script type="text/javascript">
document.getElementById('sample_Div').innerHTML="Wordpressapi is good website"; // add simple text
//document.getElementById('sample_Div').innerHTML="<img src=sample.jpg></img>"; // add image
</script>

Note: In your document “sample_Div” id with div need to be present.
put following code in your document.

<div id=\"sample_Div\">
Sample Text
</div>

Loading iframe using innerhtml is the best techniqe and solution for web services and cross domain calls.

document.getElementById('sample_Div').innerHTML = "<iframe src='http://images.purabtech.in/'></iframe>";

Both the techniques are stand for as per situation and use

How to use document.write and innerhtml
How to use document.write and innerhtml

call javascript function inside innerhtml

There is big issue We found with innerHTML function. If you try to call javascript function inside innerhtml content then we will face this problem with various.
We need to always care about Cross browser issues with javascript method.

call javascript function inside innerhtml

For Ajax and adding the dynamically content in DOM we have actually we ways.
First is simple document.write function and second function is using innerHTML.

There is some cross browser issues with both the method. First I will talk about document.write.
If we use document.write in our DOM then there is no control over the content which we are adding through document.write

Basically when we use document.write then this function will execute or add the HTML content in DOM where we call this function.

If you want to avoid this this behavior I suggest use the innerHTML. But innerHTML method is also having some issues with nested innerHTML executing with 2 or 3 level with Major browsers.
Microsoft is now planning to launch the IE9 version. But in that version they are not supporting this kind of functionality.

So Major JS library developer need to think about new approach which will give some good alternate solution.

We can achieve the nested innerHTML but we need to do some very complex development in javascript.

With innerHTML method: The property is read/write for all objects except the following, for which it is read-only:
COL, COLGROUP, FRAMESET, HTML, STYLE, TABLE, TBODY, TFOOT, THEAD, TITLE, TR. The property has no default value. Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer
5.

In this article I am going to give example about executing the simple javascript function in innerHTML.

function add_cont() {
var html_cont = 'javascript:alert(\'hello world\')">click for hello world test'+
 '<script> alert(\'tests\');'+
'var wordpressapi = document.createElement("div");'+
'wordpressapi.innerHTML = "some ad";<\/script>'
;
document.getElementById('test_htm').innerHTML = html_cont;
<div id="test_htm"></div>
javascript:add_cont()">Insert test div and text with javascript on click event.

Other best solution is all the traditional but still trusted.

document.write("<iframe src='inner_cont.html'>");
// ... Javascript code will goes here... //
document.write("</iframe&gt;");

Execute JavaScript functions in innerHTML
Execute JavaScript functions in innerHTML

I am still working on this issue to for adding nested innerHTML content.

Pure Javascript form Validation Script now easy

Web developer comes in sitution of checking forms with simple javascript. Use following Pure Javascript form Validation Script make your life easy.

Many times we come to same problem which we faced so many times. But still when Web developer comes in sitution of checking forms with simple javascript. Use following Pure Javascript form Validation Script make your life easy.

Pure Javascript form Validation Script

He started looking into some solutions. Some people try to use the some third party JS library like (Mootools, Jquery, lightbox, Prototype and etc…)

I recommend not to use these JS library because these library will take some brandwidth of your website. Most of the code these JS library is useless or un useful to your website.
Still you are adding these JS library to your website.

In this article I will show you very easy technique to the javascript form validations with minium code.

Just copy paste the following code in to your head section first.


<script type="text/javascript">
// Set maxlength value for your required fields
var maxlength = 255;
/*
* You can pass three parameters this function
* Example : ValidateRequiredField(phone,"Telephone must be filled out!", "number");
* For string format no need to pass any strFormat.
*/
function ValidateRequiredField(field,alerttxt,strFormat) {
with (field) {
if (value == null|| value == "") {
field.style.background= "grey";
alert(alerttxt);return false;
} else if (value.length > maxlength ) {
field.style.background= "grey";
alert('Maxlenth should be not more than 255 charactor');return false;
} else if (strFormat == 'number' && isNaN(value) ) {
field.style.background= "grey";
alert(field.name + ' is not a number, Please put in Numric format');return false;
} else {return true;}
}
}

/*
* Using the function you can validate the email functions
* Example: ValidateEmailAddress(email,"Email is not in Valid format!")
* Return true or false
*/
function ValidateEmailAddress(field, alerttxt) {
with (field) {
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos < 1 || dotpos-apos < 2)
{alert(alerttxt);return false;}
else {return true;}
}
}

/*
* Using the function you can validate the checkbox in the form
* Example: ValidateCheckBox(agreement,"Agreement is not checked!")
* Return true or false
*/
function ValidateCheckBox(field,alerttxt) {
with (field) {
if (!field.checked == 1) {
alert(alerttxt);return false;
} else {return true;}
}
}

/*
* Using the function you can validate the checkbox in the form
* Example: ValidateRequiredField(website,"Website name is required!")
* Return true or false
*/
function ValidateWebAddress(field,alerttext) {
with(field) {

var companyUrl = value;

var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;

if(RegExp.test(companyUrl)) {
return true;
} else {
alert(alerttext);
return false;
}
}
}

function ValidateCompleteForm(thisform) {
with (thisform) {

if (ValidateRequiredField(full_name,"First name is required!")== false) {full_name.focus();return false;}

if (ValidateRequiredField(email_address,"Email must be filled out!")== false) {email_address.focus();return false;}

if (ValidateEmailAddress(email_address,"Email is not in Valid format!")== false) {email_address.focus();return false;}

if (ValidateRequiredField(website_name,"Website name is required!")== false) {website_name.focus();return false;}

if (ValidateWebAddress(website,"Website Address is not incorrect format!")== false) {agreement.focus();return false;}

if (ValidateRequiredField(mobile,"Mobile must be filled out!", "number")== false) {phone.focus();return false;}

if (ValidateCheckBox(sex,"sex is not checked!")== false) {sex.focus();return false;}

}
}
</script>

And in you body where you are using the form just add the onsubmit=”return ValidateCompleteForm(this)” words in Form tag.

Exmaple:

<form action="submit.php" onsubmit="return ValidateCompleteForm(this)" method="post" >

Pure Javascript form Validation Script
Pure Javascript form Validation Script

Note: you can change the parameter as per your form fields names. Maxlength I kept 255 you can change this value as per your requirment.

Still if you have any doubts about this function please ask me.

Dalai Lama Joined Twitter today – Follow Dalai Lama on Twitter

First I say this is biggest and greatest news I ever got. I am big fan and follower of Dalai Lama. I am really impressed the buddhist culture and thoughts.
I think myself Buddhism is the need of world in future days and years.

Dalai Lama Joined Twitter today – Follow Dalai Lama on Twitter

I think and I say this is the biggest news of 2010 for IT world. Peace is the really future of world. If you are agreed with my article then please retweet and comment for this article.

This Dalai Lama is verified by Twitter, though — it is the real deal. Currently, the account is pulling albums and blog posts from his website and tweeting them via twitterfeed (twitterfeed), though we bet you’ll see real engagement later on. He also only has about 600 followers, but as the media picks up on his new-found Twitter presence, that will grow as well.

Dalai Lama Joined Twitter today - Follow Dalai Lama on Twitter
Dalai Lama Joined Twitter today – Follow Dalai Lama on Twitter

They have their official website called http://dalailama.com/. I really impressed with this website. I am going read all the article which is present on dalailama.com.

I am looking forward to see some good imperishable, Undestroyable and valuable tweets from Dalai Lama.

You can follow Dalai Lama Using following URL:

http://twitter.com/DalaiLama

How to unfollow twitter following people in one click

I specially love to use twitter. Many people are wondering how to unfollow unwanted or many twitter people. In this article I will going to tell about unfollow many twitter people who are inactive for long days in single click.

How to unfollow twitter following people in one click

There are some tools but that all are not free. Here I will tell you about free but still good tools which are really helpful for managing the twitter following people.

Now twitter itself is not providing the bulk unfollow facility so many sites if they are saying same. Dont faith on that sites.

Untweeps

How to unfollow twitter following people in one click
How to unfollow twitter following people in one click

This tool offers to unfollow twitter users who have not posted any tweets recently. It is very usefull to get rid of these users who don’t use twitter anymore.

Your Twitter Karma

This is another tool which is very popular because of its rich functionality and many function it offers. I specially like this website.

Best twitter desktop applications

Twitter is micro blogging website which is most popular in the small time. I specially love twitter, here are sime Best twitter desktop applications. How twitter is working. In short description we can express our self.

Best twitter desktop applications

We always need to open browser and tweet. In this post I will give the list of best twitter desktop applications.

1. TweetDeck

Allows you to split your Tweet main feeds into specific topics or groups in column formats.  This application creates a local database of all your Tweets. It allows you to continue posting Tweets even when offline. These Tweets will be pushed to your Twitter account once your are back online.

2. Twitterific

Lets you both read and publish posts or “tweets”  using a clean and concise  user interface designed to take up a minimum of real estate on your Mac’s desktop. The app shows a scrolling list of  the latest tweets from your friends, or public feeds. Its features include multiple Twitter account support, auto refreshing, inline display of replies and DMs, shows no. of unread tweets, quickly delete tweets, auto show/hide new tweets, single click access to user pages and more.

3. Twunami

A feature-rich Twitter desktop application which boasts of the following basic functionalities – configurable Tweet workspace, optional persistent reminders, on click Tweet/Retweet/SuperTweet/SuperRetweet, threaded tweets, threaded DMs, mark Tweets as read/unread, sort tweets by newest or oldest, and definitely so much features.

4. twitterfeed

twitterfeed allows you to feed your blog into Twitter. You provide the URL of a blog’s RSS feed and how often you want posts to Twitter, and twitterfeed does the rest.

5. digsby

Digsby is chat client. Using this client you can chat with yahoo, gmail, jabber, facebook, twitter.

I specially love this  chat client.

Top 10 things about all countries as per review of 2010

Everybody is always excited about knowing the best and top ten things in the world. In this article I am going to give you information about most of the things. Here is very interesting facts of every countries, 10 things about all countries as per review.

Top 10 things about all countries as per review of 2010

I created sections as per interests for putting together the top things.

Countries

1. deepest oceans and seas

2. longest rivers in the world

3. worlds largest lakes

4. largest countires

5. countries with most billionaries

6. top ten cleanest countries

7. countires with great population

8. countries with most airports

9. ten largest workstations

10. the ten household size

11. countries-most-birthday-per-day

12. lowest-average-birth-weight-in-countires

13. top-ten-countires-with-highest-life-expectancy

14. highest-death-rates-in-the-world

15. countires-with-the-highest-divorce-rates

16. countires-with-the-highest-suicide-rates

VACATIONS

17.  top-ten-best-european-cities-to-visit

18. top-ten-best-honymoon-destinations

19.top-ten-popular-dream-cruises

20. top-ten-expensive-restaurants

AUTOMOBILES

21. best-selling-cars

22. the-fastest-cars-in-the-world

23. biggest-car-production

24. most-common-causes-of-accidental-death

BUSINESS & CONSUMERISM

25. bottled-water-drinking-nations

26. biggest-alcohol-consumption

27. bread-consumers

28. chocolate-consumers

29. coffee-drinking-nations

30. ice-cream-consumeners

10 things about all countries as per review
10 things about all countries as per review

31. countries-with-the-most-number-of-cows

32. top-ten-most-intelligent-breeds-of-dogs

SPECIFIC TO THE U.S.
34. biggest-atheletes

35. the-most-intriguing-characters