ALT_IMG

Tutorials

Featuring short lessons and techniques, covering languages viz. PHP, MySQL, CSS, HTML, JavaScript, Java. The latest methods of developing web applications and basic tutorials of Java technology. You'll find free codes available in the post added with some video tutorials wherever applicable. Readmore...

ALT_IMG

How-To's

There went a rumour about the announcement of the Sony Xperia S and also we have seen some leaked photos of the model many time before. The latest leak photos had Sony Ericsson logo wearing on it but this final product image from CES has a Sony logo on the top Readmore..

Alt img

Tips and Tricks

Sony announces its very first mobile phone ‘Sony Xperia Ion’ in 10 years after it is being seperated from Ericsson at the CES 2012. Now the new products and devices is back with its brand logo of Sony instead of Sony Ericsson. is the first operator to have a Sony phone in the assortment Readmore...

ALT_IMG

Hacking Tricks

In the past few months we saw so many ultrabooks budding up in the electronic market. The Apple’s trendy MacBook Air gave the PC makers a cause to be anxious, since it is obvious that these thin-and-light laptops seems to be in a tough competiton with them. In general, Ultrabooks are the small, light, powerful Readmore...

ALT_IMG

Gadgets

The minute you get your hands on the Droid Xyboard, it is clear that this is a higher-caliber Android tablet while comparing with almost everything else available today. The tablet is sleek, properly balanced and felt comfortable in our hands. A completely new look, significantly enhanced performance and Readmore...

ALT_IMG

Internet Tweaks

There went a rumour about the announcement of the Sony Xperia S and also we have seen some leaked photos of the model many time before. The latest leak photos had Sony Ericsson logo wearing on it but this final product image from CES has a Sony logo on the top Readmore..

ALT_IMG

Tech News

There went a rumour about the announcement of the Sony Xperia S and also we have seen some leaked photos of the model many time before. The latest leak photos had Sony Ericsson logo wearing on it but this final product image from CES has a Sony logo on the top Readmore..

ALT_IMG

Downloads

There went a rumour about the announcement of the Sony Xperia S and also we have seen some leaked photos of the model many time before. The latest leak photos had Sony Ericsson logo wearing on it but this final product image from CES has a Sony logo on the top Readmore..

Showing posts with label How-to's. Show all posts
Showing posts with label How-to's. Show all posts
Friday, 28 December 2012

Google Chrome - Keyboard Shortcuts

0 comments

Access your Google Chrome browser with your keyboard ONLY.
Using keyboard shortcuts often looks cool and the same could be done in your chrome browser too since Google Chrome allows many keyboard shortcuts and using them makes our work more simpler. Checkout!

Shortcuts -

CTRL + N: Open a new window

CTRL + <Link>: Open a link in a new tab

CTRL + SHIFT + N: Open a new window in Incognito Mode

SHIFT + <Link>: Open a link in a new window

CTRL + T: Open a new tab

CTRL + SHIFT + T: Reopen the last tab that you closed

ALT + F4: Close current window

CTRL + 1: Switch to the tab in position 1 on the tab strip

CTRL + 2: Switch to the tab in position 2 on the tab strip

CTRL + 3: Switch to the tab in position 3 on the tab strip

CTRL + 4: Switch to the tab in position 4 on the tab strip

CTRL + 5: Switch to the tab in position 5 on the tab strip

CTRL + 6: Switch to the tab in position 6 on the tab strip

CTRL + 7: Switch to the tab in position 7 on the tab strip

CTRL + 8: Switch to the tab in position 8 on the tab strip

CTRL + 9: Switch to the last tab on the tab strip

CTRL + TAB: Switch to the next tab

CTRL + PAGE DOWN: Switch to the next tab

CTRL + SHIFT + TAB: Switch to the previous tab

CTRL + PAGE UP: Switch to the previous tab

CTRL + W: Close current tab or pop-up window

CTRL + F4: Close current tab or pop-up window

ALT + HOME: Open your home page

CTRL + O: Open a file in the browser

CTRL + H: View Browsing History

CTRL + B: Toggle bookmarks display

CTRL + J: View Downloads

SHIFT + ESC: View Chrome's internal Task Manager

CTRL + P: Print the current page

F5: Reload the current page

ESC: Stop the current page from loading

CTRL + F5: Reload the current page, overriding the cache

SHIFT + F5: Reload the current page, overriding the cache

ALT + <Link>: Download link

CTRL + F: Open the 'Find in page' dialog box

CTRL + G: Find the next match from 'Find in page' box

F3: Find the next match from 'Find in page' box

CTRL + SHIFT + G: Find the previous match from 'Find in page' box

SHIFT + F3: Find the previous match from 'Find in page' box

CTRL + U: View source code of the current page

CTRL + D: Bookmark the current page

CTRL + PLUS: Make text larger

CTRL + MINUS: Make text smaller

CTRL + 0: Return to default text size

BACKSPACE or ALT + LEFT ARROW: Advance to the previous page in your browsing history (for the current tab)

SHIFT + BACKSPACE or ALT + RIGHT ARROW: Advance to the next page in your browsing history (for the current tab)

ALT + E or ALT + F: Open Chrome's "wrench", or tools, menu

CTRL + SHIFT + B: Activate or disable the Bookmarks Bar.

F6 or SHIFT + F6: Advance through active components on the current page, or through items in Chrome's Address bar, Bookmarks bar, or Downloads bar.

CTRL + SHIFT + J: Open Chrome's JavaScript Console.

CTRL + SHIFT + I: Open Chrome's Developer Tools interface.

F1: Open Chrome's Help Center in a new tab or window.

CTRL + SHIFT + DELETE: Open the Clear Browsing Data window.

CTRL + ENTER: Automatically add www. (at the beginning) and .com (at the end) of the text currently residing in the Address (or URL) bar

CTRL + BACKSPACE: Remove whatever key term precedes the active cursor in the Address (or URL) bar

CTRL + L or ALT + D: Highlight the full URL in the Address bar

CTRL + K or CTRL + E: Enters a question mark in the Address bar. Typing a keyword or keywords following this question mark will submit the search term to your default engine.

CTRL + S: Save the current page to your hard drive

CTRL + C: Copy selected text or images to the Clipboard

CTRL + V or SHIFT + INSERT: Paste the current contents of the Clipboard, preserving original formatting

CTRL + SHIFT + V: Paste the current contents of the Clipboard without original formatting



Continue reading →
Thursday, 27 September 2012

How To Use Captcha in HTML Forms

0 comments


HTML forms are the essential needs of almost any website viz. contact us form. A contact us form is very useful as it aids your visitors to communicate easily in a simple way. A simple form, without a captcha on it are the chief look-outs of hackers and spammers. It is essential to secure your form against all 'holes' that those hackers are searching for.


How does the spammers/hackers exploit HTML forms?

1) As a relay for sending bulk unsolicited emails.

If you are not validating your form fields (on the serve side) before sending the emails, then hackers can alter your email headers to send the bulk unsolicited emails. (also known as email injection)


2) For sending spam messages to you.

There are programs known as 'spam-bots' that leech through the web pages looking for web forms. When found, those 'bots' just fills the fields with a spam message and submits. Eventually you will start getting many hundred submissions send by those spam bots and you will find it difficult to separate genuine submissions from spam messages.

The solution for this problem is to use a mechanism to identify human submitters from 'bots'. CAPTCHA is one of such tests.


Adding Captcha


Captcha is an image with a code written on it. The website visitor is required to read the code on the image and enter the value in a text field. If the word entered is wrong, the form submission is not processed. As CAPTCHA is a smartly blurred image, the spam bot can't read it. So the form cannot be auto-submitted by a 'bot'.



Contact form with Captcha


<form method="POST" name="contact_form"
action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
<label for="name">Name: </label>
<input type="text" name="name"
value="<?php echo htmlentities($name) ?>">
<label for="email">Email: </label>
<input type="text" name="email"
value="<?php echo htmlentities($visitor_email) ?>">
<label for="message">Message:</label>
<textarea name="message" rows=8 cols=30>
<?php echo htmlentities($user_message) ?></textarea>
<img src="captcha_code_file.php?rand=<?php echo rand(); ?>"
id="captchaimg" >
<label for="message">Enter the code above here :</label>
<input id="6_letters_code" name="6_letters_code" type="text">
<input type="submit" value="Submit" name="submit">
</form>


The HTML form above contains the fields for name, email and message. In addition, we have the CAPTCHA image. The <img> tag for the CAPTCHA image points to the script captcha_code_file.php. The PHP script in 'captcha_code_file.php' creates the image for the captcha and saves the code in a session variable named '6_letters_code'.



Validating the CAPTCHA


When the form is submitted, we compare the value in the session variable(6_letters_code) with the submitted CAPTCHA code( the value in the text field 6_letters_code). If the codes match, then we proceed with emailing the form submission. Else we display an error.

Here is the code that does the server side processing:


if(isset($_POST['submit']))
{
  if(empty($_SESSION['6_letters_code'] ) ||
    strcasecmp($_SESSION['6_letters_code'], $_POST['6_letters_code']) != 0)
  {
   //Note: the captcha code is compared case insensitively.
   //if you want case sensitive match, update the check above to
   // strcmp()
    $errors .= "\n The captcha code does not match!";
  }
  if(empty($errors))
  {
    //send the email
    $to = $your_email;
    $subject = "New form submission";
    $from = $your_email;
    $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
    $body = "A user  $name submitted the contact form:\n".
    "Name: $name\n".
    "Email: $visitor_email \n".
    "Message: \n ".
    "$user_message\n".
    "IP: $ip\n";
    $headers = "From: $from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";
    mail($to, $subject, $body, $headers);
    header('Location: thank-you.html');
  }
}



Customizing the CAPTCHA

The CAPTCHA script in the sample code download can be customized. If you open the script, you can see the first few lines of the code as shown below:



$image_width = 120;
$image_height = 40;
$characters_on_image = 6;
$font = './monofont.ttf';
//The characters that can be used in the CAPTCHA code.
//avoid confusing characters (l 1 and i for example)
$possible_letters = '23456789bcdfghjkmnpqrstvwxyz';
$random_dots = 0;
$random_lines = 20;
$captcha_text_color = "0x142864";
$captcha_noise_color = "0x142864";


You can change the size of the CAPTCHA by changing $image_width & $image_height. The number of characters in the CAPTCHA can be changed by updating $characters_on_image. Similarly, the text color of the CAPTCHA can be customized by updating $captcha_text_color. The code adds some 'noise' in the image by adding random lines and dots. you can increase or decrease the noise. Please note that increasing the noise may make it difficult for your genuine visitors to read the code.







Screenshot -




Continue reading →
Tuesday, 25 September 2012

How to Create a Horizontal Dropdown Menu with HTML, CSS and jQuery

1 comments



Menus play an essential part on the web. They allow users to find their bearings and help them navigate your website. When designing menus, usability is the key.

Beginners often struggle with the basics. In this tutorial I'm going to show you how to create a simple, usable and functional horizontal menu with HTML and CSS. I will also dive a little bit into jQuery to add animations to your menu.

This tutorial assumes you have a basic knowledge of HTML and CSS. It’s recommended to use a CSS reset for consistency. I use the one by HTML5Doctor.



The Basics


Let's start with the basic HTML structure of the menu:


<ul id="coolMenu">
<li><a href="#">Home</a></li>
<li><a href="#">Tutorials</a></li>
<li><a href="#">Gadgets</a></li>
<li><a href="#">Tips and Tricks</a></li>
<li><a href="#">Contact us</a></li>
</ul>


A menu consists of an unordered list, and each list item contains a link with the text. Don’t create unnecessary divs. You don’t need any.

To add a sub menu simply nest another unordered list inside the item that's going to have the sub menu, like this:


<ul id="coolMenu">
<li><a href="#">Home</a></li>
<li>
            <a href="#">Tutorials</a>
            <ul>
        <li><a href="#">PHP</a></li>
        <li><a href="#">MySQL</a></li>
        <li><a href="#">JavaScript</a></li>
        <li><a href="#">HTML</a></li>
        <li><a href="#">CSS</a></li>
        <li><a href="#">jQuery</a></li>
        <li><a href="#">Java</a></li>
    </ul>
        </li>
<li><a href="#">Gadgets</a></li>
<li><a href="#">Tips and Tricks</a></li>
<li><a href="#">Contact us</a></li>
</ul>


As you can see, creating the structure is very simple. This is how it should look in your browser at this stage:




There are multiple ways to set up the CSS for a horizontal menu. After many years I found that this is the quickest and cleanest way to do it:


#coolMenu,
#coolMenu ul {
    list-style: none;
}
#coolMenu {
    float: left;
}
#coolMenu > li {
    float: left;
}
#coolMenu li a {
    display: block;
    height: 2em;
    line-height: 2em;
    padding: 0 1.5em;
    text-decoration: none;
}
#coolMenu ul {
    position: absolute;
    display: none;
    z-index: 999;
}
#coolMenu ul li a {
    width: 80px;
}
#coolMenu li:hover ul {
    display: block;
}



  • I decided to float the whole menu to contain it but you can use overflow hidden or even set a fixed width for the same purpose.
  • It is important to float the list elements rather than the links.
  • The links should be displayed as blocks, otherwise, they won’t behave as expected.
  • Absolute position the submenu and hide it to remove it from the regular flow and make it invisible. Also, set a high z-index to prevent the submenu from showing behind other elements.
  • Set a height for the link elements and the line-height equal to the height to center the text vertically. By specifying a fixed height instead of just using padding you avoid flickering problems with jQuery animations later on.
  • Even though it’s not necessary to set a fixed width for the submenu items, it’s always a good practice. It allows you to style them more consistently later on.
  • Notice that the hover state is set on the list element and not the link.


With all this set, the menu should be already working. Try opening it in your browser and hovering over the third option to show the sub menu.






Improving Usability


This step will cover how to style the menu with some basic CSS to make it more accessible.


/* Main menu
------------------------------------------*/
#coolMenu {
    font-family: Arial;
    font-size: 12px;
    background: #2f8be8;
}
#coolMenu > li > a {
    color: #fff;
    font-weight: bold;
}
#coolMenu > li:hover > a {
    background: #f09d28;
    color: #000;
}

/* Submenu
------------------------------------------*/
#coolMenu ul {
    background: #f09d28;
}
#coolMenu ul li a {
    color: #000;
}
#coolMenu ul li:hover a {
    background: #ffc97c;
}


Keep in mind this is very basic, and is meant to be just an example. You can style this however you want. The important thing to remember here is, as I mentioned before that the hover states, are styled in the list items and not the links.

This is how the menu looks so far:





Adding Animations


This final step is not necessary but it’ll help you add animations to your menu with simple jQuery. The first thing you need to do, of course, is to call the latest jQuery plugin on your website:



Now, let’s add a "noJS" class to the submenu to be able to unhook the hover css state in jQuery. This will also ensure that the menu will still work when javascript is disabled.


<li>
    <a href="#">Tutorials</a>
    <ul class="noJS">
<li><a href="#">PHP</a></li>
<li><a href="#">MySQL</a></li>
<li><a href="#">JavaScript</a></li>
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">jQuery</a></li>
<li><a href="#">Java</a></li>
   </ul>
</li>


You also need to add the class to the sub menu CSS hover state:


#coolMenu li:hover ul.noJS {
    display: block; 
}


Now that everything is set let’s add some magic:


$(function(){
    $('#coolMenu').find('> li').hover(function(){
        $(this).find('ul')
        .removeClass('noJS')
        .stop(true, true).slideToggle('fast');
    });
});

The code is pretty explanatory. The script finds the immediate children list items and adds a hover function. Inside the function it removes the "noJS" class since we’re using JavaScript, and then it tells the menu to slide down on hover and to slide up on un-hover. This is achieved with the slideToggle function. The stop function prevents the animation from repeating itself if we hover multiple times.







Continue reading →
Monday, 3 September 2012

How to control your Computer using your Android Device

0 comments



There are times when you are sitting some distance away from your computer and you want to play a movie, or open a file, or browse the internet, or may be shutdown your computer. This all activities could be done using an application called Unified Remote.

Through this application you can do about every single activity that you can do with your Mouse or your Keyboard. Right from typing text in notepad, commenting on your friends Facebook status, Volume up-down of your player, opening a new tab, shutdown, restart your computer each and everything.

Its simply a 2-min job to do and you are ready to access your whole computer with your Android device.


Requirements -


1) Wi-Fi installed on your computer
2) Android Device


Steps -
You have to download two applications, one from your computer and the other from your Android device.

1) Download and install the Unified Remote server application on your computer. This will allow your device to connect and communicate to your PC on your home network. Requires Windows and .NET Framework 4.

Link:  http://www.unifiedremote.com/

2) After starting the server you will have to allow the software to bypass your firewall. This is again an important step as the Unified Remote server application on your computer must be allowed to bypass your firewall for it to connect to your Android device.





3) There appears a Unified Remote icon on your task bar. You can control the server (Start/Stop) from here.




4) When you double click the icon a window opens from where you can Start/Stop the Unified Remote application server when not in use.




5) Now your computer part is done. Time for installing the Unified Remote app on your Android device.
Search into Google Play from your Android device for "Unified Remote" and download the FREE version. Or go to the link,



Screenshots of Unified Remote app-

 




Here's a demo video:


Continue reading →
Tuesday, 28 August 2012

Lock Folder without any Software

1 comments



Sometimes you have been asking for an alternative way to lock folders without the use of any alternative software. It’ll 5 steps ahead only, check now!


Steps:

1) In Notepad copy the code below.
2) The default password is “paragtyagi”. Change your password in the code, where it shown as paragtyagi in yellow background. Password may be any combination of alpha or/and numeric.
3) Save this file as “locker.bat”.
4) Now double click on locker.bat.
5) It will create a folder named: Locker with automatic lock. After creation of the folder, place the contents (your files & folders) you wants to lock inside the Folder and double click locker.bat again. It will ask to lock the folder Y/N. If you press y then it will lock the folder and your folder will be hide. To unlock run again locker.bat, it will ask to enter password, type in correct password and you can see your folder back.
* Please don’t change anything except password, otherwise this lock may does not work.


************Code starts line below*************


cls 
@ECHO OFF 
title Folder Locker 
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK 
if NOT EXIST Locker goto MDMANNUFORALL 
:CONFIRM 
echo Are you sure to Lock this folder? (Y/N) 
set/p "cho=>" 
if %cho%==Y goto LOCK 
if %cho%==y goto LOCK 
if %cho%==n goto END 
if %cho%==N goto END 
echo Invalid choice. 
goto CONFIRM 
:LOCK 
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" 
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" 
echo Folder locked 
goto End 
:UNLOCK 
echo Enter password to Unlock Your Secure Folder 
set/p "pass=>" 
if NOT %pass%== paragtyagi goto FAIL 
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" 
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker 
echo Folder Unlocked successfully 
goto End 
:FAIL 
echo Invalid password 
goto end 
:MDMANNUFORALL 
md Locker 
echo Locker created successfully 
goto End 
:End


**************Code ends line above***************

Continue reading →