Blogger Plug 'n' Play

NOTICE

Adfly Links not working Find Direct Links HERE

How to build long forms using php in a short cut way

We can build a long form using php's foreach function in the following way. It makes the form more manageable and clean
<form name="myform" method="get" action="business.php" onsubmit="">
<?php

$postvalue=array("Name"=>"0","Email"=>"1","Phone"=>"2");
foreach($postvalue as $key => $value)
{
  echo ''.$key.'<input type="text" id="id'.$value.'" name="name['.$value.']" value=""><div id="err'.$value.'"></div><br>';
}

?>
<input type="submit" onclick="checkValidit()">
</form>
We can add any number of keys and values in array To get the values we can use following code
<?php
session_start();
$value = $_GET["name"];

foreach ($value as $uni) {
    $_SESSION[$uni] = $uni;
}

foreach ($value as $uni) {
    echo $_SESSION[$uni] . "<br>";
}
?>
Learn more »

jQuery Form Validation Email and Phone Number

HTML FORM
<form name="myform" method="get" action="business.php" onsubmit="">
Name<input type="text" id="id0" name="name[0]" value=""><div id="err0"></div><br>Email<input type="text" id="id1" name="name[1]" value=""><div id="err1"></div><br>Phone<input type="text" id="id2" name="name[2]" value=""><div id="err2"></div><br><input type="submit" onclick="checkValidit()">
</form>
jQuery Validation Code
<script type="text/javascript">
         function isValidEmailAddress(emailAddress) {
             var pattern = new RegExp(/^([w-.]+@([w-]+.)+[w-]{2,4})?$/);
             return pattern.test(emailAddress);
         };
         
         
         function isValidPhone(phone) {
             var pattern = new RegExp( /^d*[0-9](|.d*[0-9]|,d*[0-9])?$/);
             return pattern.test(phone);
         };
         
         function checkValidit()
         {
             if( !$("input").val() ) {
                 $("form").submit(function (e) {
                     e.preventDefault(); //prevent default form submit
                 });     
             }
         };
         
         
         
         
         $(function(){ 
             
             
             $('input').blur(function()
             {
                 if($(this).attr("id")=="id1")
                 {
                     // alert("email");
                     if( !isValidEmailAddress($(this).val()) ) 
                     {
                         $("#err1").html("Enter Valid Mail");
                     }else if(!$(this).val()){
                         $("#err1").html("Enter Mail");
                     }
                     else{
                         $("#err1").html("");
                     }
                     
                 }
                 else if($(this).attr("id")=="id2")
                 {
                     if( !isValidPhone($(this).val()) ) 
                     {
                         $("#err2").html("Enter Valid Phone");
                     }else if(!$(this).val()){
                         $("#err1").html("Enter Phone");
                     }
                     else{
                         $("#err2").html("");
                     }
                 }
                 else if($(this).attr("id")=="id0")
                 {
                     if( !$(this).val() ) 
                     {
                         $("#err0").html("Enter Name");
                     }
                     else{
                         $("#err0").html("");
                     }
                 }
             });
             
         });   
         
     </script>

Learn more »

Sector 17 Chandigarh @ Crazy Confessions India

Learn more »

Check Net balance in Reliance 3G Datacard

send MBAL to 55333 (toll free)
Learn more »

Free Web Hosting Websites with your own domains with 99% Uptime

1) FreeWebHostingArea.com  PHP,Mysql Support

2) 000WebHost. PHP,Mysql Support

3) Award Space

4) 1FreeHosting

5) 2FreeHosting
Learn more »

PhpMyAdmin default password

go to file

C:\wamp\www\phpMyAdmin-4.0.1-all-languages\libraries\config.default.php 

Search $cfg['Servers'][$i]['AllowNoPassword'] = false;

and change it to "true"
Learn more »

Form Validation Using jQuery and Showing A single Alert for Validation

In This Form We are Using Following Form Elements:

Input Text
Radio
Check
Select

Validation is done using pure jQuery



Learn more »

Get Multiple Url Parameters with Same Name Using PHP

index.php?paraname=VALUE1&paraname=VALUE2&paraname=VALUE3&paraname=VALUE4
Now if we get paraname parameter as follow $val = $_REQUEST['paraname']; // Output only last value VALUE4 we can bind all parameters in an array by doing a change in the form from where the values are coming like as follow

<form action="" method="get">
<input name="paraname[]">
<input name="paraname[]">
<input name="paraname[]">
<input name="paraname[]">
</form>

Then we can request the values as
<php

$val = $_REQUEST['paraname'];


foreach ($val as &$Mvalue) {
     
  echo $Mvalue."<br>"; 
 }
?>
Learn more »

How to disable warnings and notices in php.ini and WAMP

open php.ini Search "error_reporting = E_ALL" and Replace it with "error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING" .After saving restart the WAMP 
Learn more »

How to hide or remove div using Escape key from keyboard using JavaScript and jQuery

Using JavaScript


<script type="text/javascript">
 window.onkeyup = function (event) {
  if (event.keyCode == 27) {
    document.getElementById(boxid).style.visibility="hidden";
  // window.close();
  }
 }
</script>


Using jQuery


$( document ).on( 'click', function ( e ) {
    if ( $( e.target ).closest( elem ).length === 0 ) {
        $( elem ).hide();
    }
});
$( document ).on( 'keydown', function ( e ) {
    if ( e.keyCode === 27 ) { // ESC
        $( elem ).hide();
    }
});
Learn more »

"Could not complete your request because the file-format module cannot parse the file" error in photoshop CS3 on opening .png file

Solution

let the file image.png is showing this error "Could not complete your request because the file-format module cannot parse the file" popup.

1) Now Right click on image.png and open with Paint

2) Go to File >> Save-As >>Select PNG format >> then Save and Overwrite the previous file ( Don;t woryy the quality of image remain same )

3) Now you have a new image.png file which can be open with Photoshop without any Error pop up.
Learn more »

PHP get multiple CheckBox value using form



<?php 
 $rtt = "";
    $chk = $_REQUEST['txtOwn'];
     if(empty($chk))
     {
  echo("You do not own anything.");
     }
     else
     {
  $N = count($chk);
  for($i=0; $i < $N; $i++)
  {
   $rtt = $rtt."  ,".$chk[$i];
  }
     } 
  
  echo $rtt;
?>


<form method="get">
 <input type="checkbox" name="txtOwn[]" value="AC" />AC<br />
 <input type="checkbox" name="txtOwn[]" value="Fridge" />Fridge<br />
 <input type="checkbox" name="txtOwn[]" value="TV" />TV<br />
 <input type="checkbox" name="txtOwn[]" value="Mobile" />Mobile<br />
 <input type="checkbox" name="txtOwn[]" value="Car" />Car<br />
 <input type="submit" >
 </form>


Learn more »

Verticle Auto Scroll News Ticker Wordpress Using jQuery For Blogger Version 2


This news ticker is vertical scroller which stops for a while when heading appears then moves .It stops only on mouse-over. It is continuous and very small code to apply. view demo for complete code

Learn more »

Countdown Timer then Show Download Link using Javascript

This code can be used in situation where we want to show a countdown before showing any link or anything

See Demo
Learn more »

ScrollTo() Alternative jQuery Navigation/ Tab Menu To Scroll to a div In a page

Using jQuery we can easily scroll to the required div by using any event like click , Mouse over etc. Same jQuery Function can be used to scroll multiple Divs. No change required in function during addition or removal of any div to scroll. Small Snippet jQuery's ScrollTo function alternative. See Demo for its Working and code


jQuery Function Used. Complete code in demo link

$(document).ready(function (){
        $(".click").click(function (){
           var pos = $(this).attr("position");
                $('html, body').animate({
                    scrollTop: $("#"+pos).offset().top}, 2000);
        });
    });

Learn more »

New Auto Horizontal Image Slider[Style 2] Using jQuery For Blogger Blog

Auto Image slider with great flexibility to re-size the total container and width and length of thumbnails or image. Very light with small code for execution.

See the DEMO for its working. And below CSS code to change container size and thumbnail size

                        #intro {
    width: 580px;
    margin: 0 auto;
   }
   .wrapper {
    background-color: white;
    width: 480px;
    margin: 40px auto;
    padding: 50px;
    box-shadow: 0 0 5px #999;
   }
   .list_carousel {
    background-color: #ffffff;
    margin: 0 0 30px 60px;
    width: 710px;
   }
   .list_carousel ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: block;
   }
   .list_carousel li {
    font-size: 40px;
    color: #999;
    text-align: center;
    background-color: #eee;
    border: 5px solid #999;
    width: 200px;
    height: 150px;
    padding: 0;
    margin: 6px;
    display: block;
    float: left;
   }
   .list_carousel.responsive {
    width: auto;
    margin-left: 0;
   }
   .clearfix {
    float: none;
    clear: both;
   }
   .prev {
    float: left;
    margin-left: 10px;
   }
   .next {
    float: right;
    margin-right: 10px;
   }
   .pager {
    float: left;
    width: 300px;
    text-align: center;
   }
   .pager a {
    margin: 0 5px;
    text-decoration: none;
   }
   .pager a.selected {
    text-decoration: underline;
   }
   .timer {
    background-color: #999;
    height: 6px;
    width: 0px;
   }

View Demo for complete code
Learn more »

How to Type only selective text in a Text Field/Box

We can Disable some characters from being written in a text field by using below functions



with JQuery


 $("input").keypress( function(e)
{ var chr = String.fromCharCode(e.which);
 if ("12345NOABC".indexOf(chr) < 0)
 return false;
 }); 


without JQuery 


 document.getElementById("foo").onkeypress = function(e)
 { var chr = String.fromCharCode(e.which);
 if ("12345NOABC".indexOf(chr) < 0)
 return false;
};
Learn more »

JavaScript PDF Reader/Viewer to Embed in a Webpage

JavaScript based PDF reader/ viewer ca be used to embed a viewer on webpage to read PDF file. It also have extended capabilities like Zooming, Search next page and prev page, Goto page box.

We can pass a parameter to use any PDF file with is viewer.

See DEMO and get Files HERE
Learn more »

Check if text field contains only Numericals

function check()
{
    var val = document.getElementById("chkk").value;
    if(val.match(/^\d+$/)) {
       alert(document.getElementById("chkk").value);
     }
    else{alert("Please entere valid number");}
   
}
Learn more »

3D Circular continuous Round about image Scroller

3D Circular continuous Round about image Scroller

Round about Image Scroller is mostly found in flash. But this is bruit using jQuery. Clicking on perticuler image moves it to first. We can also give links in it. View its Demo for Code and detailed working.



Learn more »

Simple jQuery Accordion Menu

simple jQuery accordion menu using Css. See Demo for code and its Working

Learn more »

Floating DIV/ Light Box in page using jQuery for Every Content


Light box which opens in the middle of page with any type of content like images text audio and video. Any type of content can be embedded in light box. It basically opens a div in middle which contains another link to a page with any type of content.

See demo For code and files.


Learn more »