Wednesday 13 May 2015

Deprecated: Function split() is deprecated


Code:
  
  $name = "abc,def,ghi,jkl";

  $nameArray = split("\,", $name);
  
  echo count($nameArray);
  
  for($i=0;$i";
  }
  $name = "abc,def,ghi,jkl";

  $nameArray = preg_split("/,/", $name);//  split to preg_split and \, to changed /,/
  
  echo count($nameArray);
  
  for($i=0;$i";
  }
Solved:
  
   $name = "abc,def,ghi,jkl";

  $nameArray = preg_split("/,/", $name);//  split to preg_split and \, to changed /,/
  
  echo count($nameArray);
  
  for($i=0;$i";
  }

Thursday 7 May 2015

how to get radio button value in jquery?

<html>
      <body>

                <input type="radio" name="abc" value="1">A
                <input type="radio" name="abc" value="2">B
                <input type="radio" name="abc" value="3">C
                <input type="radio" name="abc" value="4">D
                <input type="radio" name="abc" value="5">E         

                <button id="submit">submit</button>


               <script>
                          $(function(){
                                $("#submit").click(function(){      
                                        alert($('input[name=q12_3]:checked').val());
                                });
                          }); 

               </script>

      </body>
</html>

Click HTML button to call PHP function

This code for simple to click a html button to call php function

Eg:

<html>
        <body>
              <form action="TestingFile.php" method="post">
                        <input type="submit" name="calculate" value="add">
                        <input type="submit" name="calculate" value="subtract">
                        <input type="submit" name="calculate" value="multiply">
              </form>
        </body>
</html>

<?php

if(!isset($_POST['calculate']))
{
$_POST['calculate'] = "";
}

switch ($_POST['calculate'])
{

      case 'add':
                         echo "add";//add function here
                         break;

      case 'subtract':
                             echo "subtract";//add function here
                             break;

      case 'multiply':
                              echo "multiply";//add function here
                              break;
default :

                          echo "defalt";//add function here
}

?>

Saturday 2 May 2015

Upgrade Oracle Java 7 to Java 8 for Ubuntu

How to update jdk latest version in ubuntu or ubuntu server or aws ubuntu server

cmds:
          sudo add-apt-repository ppa:webupd8team/java
     sudo apt-get update

     sudo apt-get install oracle-java8-installer


Eg:
              ubuntu@ip-0-0-0-0:~$ sudo add-apt-repository ppa:webupd8team/java
              ubuntu@ip-0-0-0-0:~$ sudo apt-get update

              ubuntu@ip-0-0-0-0:~$ sudo apt-get install oracle-java8-installer

Friday 1 May 2015

how to make or remove underline in css/html


CSS:

<style>
             text-decoration:none;   //remove underline
             text-decoration:underline;   //make underline
</style>

Eg:
      a:hover {
         text-decoration: underline;
      }

      a:active {
         text-decoration: underline;
      }
     a:hover {
         text-decoration: none;
      }

      a:active {
         text-decoration: none;
      }