Tuesday, July 16, 2013

Simple Drop Down Menu

Write This HTML Code in Body Tag


<nav id="main-nav">
    <ul id="nav-primary">
        <li><a href="#">Menu 1</a>

            <ul class="subnav">
                <li><a href="#">Lorem Ipsum Dolor</a>
                </li>
                <li><a href="#">Ham cow meatball pork chop</a>
                </li>
                <li><a href="#">Lorem Ipsum Dolor</a>
                </li>
                <li><a href="#">Ham cow meatball pork chop</a>
                </li>
              
            </ul>
        </li>
        <li><a href="#">Menu 2</a>

            <ul class="subnav">
                <li><a href="#">Lorem Ipsum Dolor</a>
                </li>
                <li><a href="#">Ham cow meatball pork chop</a>
                </li>
                <li><a href="#">Lorem Ipsum Dolor</a>
                </li>
                <li><a href="#">Ham cow meatball pork chop</a>
                </li>
              
            </ul>
        </li>
        <li><a href="#">Menu 3</a>

            <ul class="subnav">
                <li><a href="#">Lorem Ipsum Dolor</a>
                </li>
                <li><a href="#">Ham cow meatball pork chop</a>
                </li>
                <li><a href="#">Lorem Ipsum Dolor</a>
                </li>
                <li><a href="#">Ham cow meatball pork chop</a>
                </li>
              
            </ul>
        </li>
    </ul>
</nav>

Write This CSS Code in Style Tag(Which is in Head Tag) or Write in External CSS File


#main-nav {
    width: 100%;
    height: 67px;
    background: #f2f2f2;
}
#main-nav .subnav {
    display: none;
    position: absolute;
    top: 67px;
    left: 0px;
    width: 100%;
    list-style-type: none;
    background: #fff;
    margin: 0;
    border:solid 1px #eeeeee;
    padding:0;
}
#main-nav .subnav li {
    display: block;
    border-bottom: solid 1px #eeeeee;
    margin:0;
}
#main-nav .subnav li a {
    color: #333;
    height:18px;
    padding:10px 0;
    font-size:13px;
}
#main-nav .subnav li a:hover {
    background:#f9f9f9;
}
#nav-primary {
    list-style: none;
    margin: 0;
    float: left;
    padding:0;
}
#nav-primary li {
    float: left;
    position: relative;
}
#nav-primary li a {
    float: left;
    color: #000;
    text-align: center;
    font-size: 14px;
    height: 48px;
    padding-top: 19px;
    line-height: 16px;
    width: 164px;
    text-decoration:none;
}
#nav-primary li a:hover {
    text-decoration:none;
}
#nav-primary li:hover .subnav {
    display: block;
}

OUTPUT

Drop Down Menu


Wednesday, July 3, 2013

PHP Script To Get A Mac Address Of User/Client


Logic 1 :


<?php 
/* 
* Getting MAC Address using PHP 
* Mr. Vetrivel Samidurai 
*/ 

ob_start(); // Turn on output buffering 
system('ipconfig /all'); //Execute external program to display output 
$mycom=ob_get_contents(); // Capture the output into a variable 
ob_clean(); // Clean (erase) the output buffer 

$findme = "Physical"; 
$pmac = strpos($mycom, $findme); // Find the position of Physical text 
$mac=substr($mycom,($pmac+36),17); // Get Physical Address 

echo $mac; 
?>

Logic 2 :


$ipAddress=$_SERVER['REMOTE_ADDR'];

#here U can run external command

$arp=`arp -a $ipAddress`;
$lines=explode("n", $arp);

#looking up the arp U need
foreach($lines as $line){
$cols=preg_split('/s+/', trim($line));
if ($cols[0]==$ipAddress)
$macAddr=$cols[1];
}

Wednesday, June 19, 2013

What Is The Meaning Of S In OOPS

This is most common misunderstood short form related to object oriented paradigm. If somebody asks which paradigm you use or on which paradigm Java works. We generally answer it as OOPS or OOPs. And here we do mistake. Also this came as a conundrum when interviewer asked to my buddy what “s” stands for.


First grab the full form, then I will explain it further—
Differentiate OOPS and OOP
Differentiate OOPS and OOP
Oops!! Yes. This is the sound you must whisper. Well OOP you already know, following is the definition of OOPS (actually oops – not in CAPS)
Definition of oops
Yes this is official definition of oops.
******************************************************************************
Some other views of Programmers related to the full form of OOPs or the meaning of s in OOPs
1. OOPs - Object oriented programming system
2. OOPs - Object oriented programming structure
3. OOPS is commonly a misused abbreviation. Originally it is OOP - Object Oriented Programming or     might refer toObject Oriented Programming Language
4. s indicates Plurality or multiplicity at the end of a word in the English language. But in general s in oops is System.
********************************************************************************************************