WebSocket() constructor

socket with the WebSocket() constructor:
var s = new WebSocket("ws://ws.example.com/resource");
The argument to the WebSocket() constructor is a URL that uses
the ws:// protocol (or wss:// for a secure connection like that
used by https://). The URL specifies the host to connect to,
and may also specify a port (WebSockets use the same default
ports as HTTP and HTTPS) and a path or resource.
Once you have created a socket, you generally register event
handlers on it:
s.onopen = function(e) { /* The socket is open. */ };
s.onclose = function(e) { /* The socket closed. */ };
s.onerror = function(e) { /* Something went wrong! */ };
s.onmessage = function(e) {
var m = e.data; /* The server sent a message. */
};
In order to send data to the server over the socket, you call the
send() method of the socket:
s.send("Hello, server!");
When your code is done communicating with the server, you
can close a WebSocket by calling its close() method.
WebSocket communication is completely bidirectional. Once
a WebSocket connection has been established, the client and
server can send messages to each other at any time, and that
communication does not have to take the form of requests and
responses.

3 Top Internet Marketing Tips

One Traffic Source
Submit your Blog to Content Aggregators like AllTop.com and 9Rules.
If you have a top-notch blog that regularly publishes valuable content (which you should), then you can submit your blog to sites like Alltop.com and 9Rules.com. These are content aggregators that aggregates the best content from around the web.


Write Tutorials! Tutorials are a HUGE untapped traffic source online. If you have a
website related to graphic design, wordpress, web development, SEO,
marketing, or programming, then you can use tutorials to send thousands of visitors to your website.  There are hundreds of websites online that you can submit your tutorials to.

SEO your Site 
  • Format — text or image? image map? javascript? drop-downs? Text is best.
  • Page URLs — look at URL structure, path names, file names. How long are URLs? How far away from the root are they? Are they separated by dashes or underscores?
  • Are keywords used appropriately in text links or image alt tags?

Reading DOC file in php

  read PDF and DOC files using PHP

Reading PDF Files

 
$content = shell_exec('/usr/local/bin/pdftotext '.$filename.' -');
 
 

Reading DOC Files

 $content = shell_exec('/usr/local/bin/antiword '.$filename);


concat() Method

The concat() method returns the array resulting from appending its arguments to
 the array on which it was invoked. Given the script:

Blog Flipping?

Practicing selling blog to other after attaining traffic and popularity 
is known as Blog Flipping.

List some SEO techniques you follow when a new site is given?

Check with on page factors such as Meta tags, Title, Keywords and Meta description in content.
• Site is submitted to major search engines
• Bookmarking site pages
• Directory submission
• Press release which announces your site launch
• Blog commenting
• Submitting articles to concentrate article readers
• Web 2.0 page creation
Classifieds to target local users

Black Hat SEO?

several websites to get high ranking is brought numerous
methods and techniques to achieve goal.

Interview Questions-Networking



·         What is an IP address?
·         What is a subnet mask?
·         What is ARP?
·         What is ARP Cache Poisoning?
·         What is the ANDing process?
·         What is a default gateway? What happens if I don't have one?
·         Can a workstation computer be configured to browse the Internet and yet NOT have a default gateway?
·         What is a subnet?
·         What is APIPA?
·         What is an RFC? Name a few if possible (not necessarily the numbers, just the ideas behind them)
·         What is RFC 1918?
·         What is CIDR?
·         You have the following Network ID: 192.115.103.64/27. What is the IP range for your network?
·         You have the following Network ID: 131.112.0.0. You need at least 500 hosts per network. How many networks can you create? What subnet mask will you use?
·         You need to view at network traffic. What will you use? Name a few tools
·         How do I know the path that a packet takes to the destination?
·         What does the ping 192.168.0.1 -l 1000 -n 100 command do?
·         What is DHCP? What are the benefits and drawbacks of using it?
·         Describe the steps taken by the client and DHCP server in order to obtain an IP address.
·         What is the DHCPNACK and when do I get one? Name 2 scenarios.
·         What ports are used by DHCP and the DHCP clients?
·         Describe the process of installing a DHCP server in an AD infrastructure.
·         What is DHCPINFORM?
·         Describe the integration between DHCP and DNS.
·         What options in DHCP do you regularly use for an MS network?
·         What are User Classes and Vendor Classes in DHCP?
·         How do I configure a client machine to use a specific User Class?
·         What is the BOOTP protocol used for, where might you find it in Windows network infrastructure?
·         DNS zones – describe the differences between the 4 types.
·         DNS record types – describe the most important ones.
·         Describe the process of working with an external domain name
·         Describe the importance of DNS to AD.
·         Describe a few methods of finding an MX record for a remote domain on the Internet.
·         What does "Disable Recursion" in DNS mean?
·         What could cause the Forwarders and Root Hints to be grayed out?
·         What is a "Single Label domain name" and what sort of issues can it cause?
·         What is the "in-addr.arpa" zone used for?
·         What are the requirements from DNS to support AD?
·         How do you manually create SRV records in DNS?
·         Name 3 benefits of using AD-integrated zones.
·         What are the benefits of using Windows 2003 DNS when using AD-integrated         
        zones?
·         You installed a new AD domain and the new (and first) DC has not registered its
SRV records in DNS. Name a few possible causes.
·         What are the benefits and scenarios of using Stub zones?
·         What are the benefits and scenarios of using Conditional Forwarding?
What are the differences between Windows Clustering, Network Load Balancing  and Round Robin, and scenarios for each use?
·         How do I work with the Host name cache on a client computer?
·         How do I clear the DNS cache on the DNS server?
·         What is the 224.0.1.24 address used for?
·         What is WINS and when do we use it?
Can you have a Microsoft-based network without any WINS server on it? What are the "considerations" regarding not using WINS?
·         Describe the differences between WINS push and pull replications.
What is the difference between tombstoning a WINS record and simply deleting  it?
Name the NetBIOS names you might expect from a Windows 2003 DC that is   registered in WINS.
·         Describe the role of the routing table on a host and on a router.
·         What are routing protocols? Why do we need them? Name a few.
·         What are router interfaces? What types can they be?
·         In Windows 2003 routing, what are the interface filters?
·         What is NAT?
·         What is the real difference between NAT and PAT?
·         How do you configure NAT on Windows 2003?
·         How do you allow inbound traffic for specific hosts on Windows 2003 NAT?
·         What is VPN? What types of VPN does Windows 2000 and beyond work with natively?
·         What is IAS? In what scenarios do we use it?
·         What's the difference between Mixed mode and Native mode in AD when dealing with RRAS?
·         What is the "RAS and IAS" group in AD?
·         What are Conditions and Profile in RRAS Policies?
·         What types or authentication can a Windows 2003 based RRAS work with?
·         How does SSL work?
·         How does IPSec work?
·         How do I deploy IPSec for a large number of computers?
·         What types of authentication can IPSec use?
·         What is PFS (Perfect Forward Secrecy) in IPSec?
·         How do I monitor IPSec?
·         Looking at IPSec-encrypted traffic with a sniffer. What packet types do I see?
·         What can you do with NETSH?
·         How do I look at the open ports on my machine?

555 php Interview Questions

  • How can we get the browser properties using PHP?
  • What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?
  • sorting an array?
  • What is maximum size of a database in MySQL?
  • Give the syntax of Grant and Revoke commands?
  • Explain Normalization concept?
  • How can we find the number of rows in a table using MySQL?
  • How can we find the number of rows in a result set using PHP?
  • How many ways we can we find the current date using MySQL?
  • What are the advantages and disadvantages of Cascading Style Sheets?
  • What type of inheritance that PHP supports?
  • How show an image from mysql?
  • How  group the results of a mysql query?
  • How can increase the performance of MySQL select query?
  • What are the advantages/disadvantages of MySQL and PHP?
  • What is the difference between GROUP BY and ORDER BY in Sql?
  • What is the difference between char and varchar data types?
  • What is the functionality of md5 function in PHP?
  • How can I load data from a text file into a table?
  • How can we know the number of days between two given dates using MySQL?
  • How can we know the number of days between two given dates using PHP?
  • How can we change the name of a column of a table?
  • How can we change the name and data type of a column of a table?
  • What are the differences between drop a table and truncate a table? 
  • How do I sort an array by key?
  • When you want to show some part of a text displayed on an HTML page in red font color, what different possibilities are there to do this? What are the advantages/disadvantages of these methods?
  • When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?
  • What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods?
  • An Apache web server is running on a Linux system. Suddenly, the web server delivers the pages very slow. How could you find out possible reasons for that (when using system commands, please specify their names)?
  • What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?
  • Please give a regular expression (preferably Perl/PREG style), which can be used to identify the URL from within a HTML link tag. Example: The regular expression should match the tag <A HREF=”http://www.yoursite.com/”> and give the URL (”http://www.yoursite.com /”) as a return result. Tags should also be matched if they contain other attributes than the HREF attribute.
  • A select query over a large table runs very slow because of the growing number of entries in that table. What different measures could be taken to improve speed?
  • A company wants to store their invoices in a database. They already have their customers and articles in that database. Both customer and article are each identified by an unique integer value. Please create the SQL statements for creating the necessary table(s) for storing the invoices in a MySQL database. An invoice should hold information like invoice number, customer, date, article(s) and quantity etc.
  • For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number “1234″. The query should be able to run under a MySQL 4.0 database.
  • How would you backup and restore a big MySQL database? What are the advantages of the approach which you have taken over the others?
  • Create a PHP web script with the following attributes: on start, three HTML form elements are shown: an string input field, a checkbox field, a dropdown/pull down list with 5 elements and a submit button. On submission, the form should be redisplayed (while remaining all options/inputs as the user has selected/entered them). Additionally, the selections/inputs of the user should be displayed in text. Please solve this without the use of any external libraries.
  • What is MIME?
  • What is PEAR in PHP?
  • How can I use the COM components in PHP?
  • How can I load the DLLs dynamically?
  • How many ways we can give the output to a browser?
  • How can we know that a session is started or not?
  • What is the default session time in PHP and how can I change it?
  • What changes I have to done in PHP.ini file for file uploading?
  • What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?
  • How can I set a cron and how can i execute it in Unix, Linux, and windows?
  • Steps for the payment gateway processing?
  • How can I rotate an image?
  • find the longest value in my mysql table?
  • How many ways I can register the variables into session?
  • Explain different types of errors in PHP (i.e. arguments in errorreporting function)?
  • How many ways I can redirect a PHP page?
  • List out different arguments in PHP header function?
  • What type of headers have to add in the mail function in which file a attached?
  • What is the difference between <?PHP and <? And which is preferable?
  • What are the differences between include() and include_once() functions?
  • Describe the importance of database abstraction layers in PHP and database connection?
  • Explain MySQL optimization?
  • How do I order the results of my query?
  • What is the difference between using copy() and move() function in PHP file uploading?
  • What is the difference between Reply-to and Return-path in the headers of a mail function?
  • Explain about Type Juggling in PHP?
  • How do I check for an empty field in a form?
  • How can I get the only name of the current executing file?
  • How can I embed a Java program in PHP file and what changes have to be done in PHP.ini file?
  • How can I find what type of images that the PHP version supports?
  • How can I access information sent through POST on a form?
  • What is the difference between a framework, IDE, CMS, Blog
  •  remove HTML tags from a string?
  • What is the difference between client side validation and server side validation? 
  • How can I add text to an image?
  • What is a static variable within a function?
  • What are key tasks for Php executive?
  • $_ENV and $_SERVER ?
  • Cookies Versus Sessions?
  • What is the use of PEAR in php?
  • What Is a Function?
  • $_GET , $_POST,$_COOKIE??
  • Associative Arrays?
  • magic_quotes_gpc, magic_quotes_runtime?
  • What are the different tables present in mysql?
  • What is SQL Injection?
What are encryption functions in PHP?
ans-CRYPT,MD5

How to create a mysql connection?
mysql_connect(servername,username,password);

<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
What is SSL ?
 SSL stands for Secure Sockets Layer.The Secure Sockets Layer (SSL) is a commonly-used protocol for managing the security of a message transmission on the Internet.

 Finding the Current Date and Time?
 ans-
Use strftime( ) or date( ) for a formatted time string:
print strftime('%c');
print date('r');
Mon Aug 12 18:23:45 2002
Mon, 12 Aug 2002 18:23:45 -0400
Use getdate( ) or localtime( ) if you want time parts:
$now_1 = getdate( );
$now_2 = localtime( );
print "$now_1[hours]:$now_1[minutes]:$now_1[seconds]";
print "$now_2[2]:$now_2[1]:$now_2[0]";
18:23:45
18:23:45
 
Finding the Difference of Two Dates? 
ans-
Convert both dates to epoch timestamps and subtract one from the other. Use this code to separate the difference into weeks, days, hours, minutes, and seconds:

$epoch_1 = mktime(19,32,56,5,10,1965);
 $epoch_2 = mktime(4,29,11,11,20,1962);
 $diff_seconds = $epoch_1 - $epoch_2;
$diff_weeks = floor($diff_seconds/604800);


How I can get IP address?
ans-getenv("REMOTE_ADDR");

How to store binary data in MySQL?
ans-Use BLOB data type for the database field.

What is CAPTCHA?
ans-CAPTCHA stands for Completely Automated Public Turing Test to tell Computers and Humans
 Apart. To prevent spammers from using bots to automatically fill out forms,
 CAPTCHA programmers will generate an
image containing distorted images of a string of numbers and letters.

What is the difference between sizeof($array) and count($array)?
ans-sizeof($array) - This function is an alias of count()
count($array) - If you just pass a simple variable instead of an array it will return 1.

What is the difference between the functions unlink and unset?
ans-
unlink is a function for file system handling. It will simply delete the file in context.
unset will set UNSET the
specified variable.
unlink is used to delete a file. unset is used to destroy an earlier declared variable.


What is the difference between echo and print?
ans-
echo displays multiple statements and variables but print only
  print is function it returns a value.

What is the default session time in php?
The default session time in php is until closing of browser



PHP Classes

Classes do not use scope keywords, but you can prevent people from instantiating the class by making
the __construct() method and the __clone() methods private or protected. The __construct()
method is used to create the object so if it is not accessible, the object cannot be created. You don’t need
a __construct() method in your class to create an object, but if there is a __construct() method
then it needs to be available. So if you don’t need a __construct() method but don’t want people to