Tuesday, 7 July 2015

Complete code for mobile app sending data to php & php inserting that data to databse (A MOBILE APP SINGUP SYSTEM)

                                                    ( A MOBILE APP  SINGUP  SYSTEM)


1) SOURCE  CODE  OF  APP  SIDE :::---

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

    <script>

        $(document).on("pagecreate", "#pageone", function ()
        {
            $("li").on("swipe", function () {
                $(this).hide();
            });
            $(document).on("scrollstart", function () {
                alert("you started scroling!!");
            });
        });


       function checkLogin()
        {
            alert("abs");

            var aa = document.getElementById("name").value;
            var bb = document.getElementById("pass").value;
            alert(aa);
            alert(bb);

            var data =
            {
                user: aa,
                pass: document.getElementById("pass").value
            };

            $.getJSON("http://mapg.host22.com/mobileapp/insert.php?jsonp=?", data, function (data,status) {

                var status = JSON.stringify(data['status']);
                alert(data['status']);

                alert(status);              ////  how program works= status;
                alert(data);                /// all the echo of insert.php  is  data;   echo of insert.php= data;

            }
            );
        }
        
    </script>
</head>

<body>
    <div data-role="page" id="pageone">
        <div data-role="header">
            <h1>page 1</h1>
        </div>

        <div id="mess" >

        </div>

        <div data-role="main" class="ui-content">
            <p> LOGIN PAGE </p>
            Username : <input type="text" id="name" placeholder="your Name " />
            Password : <input type="password" id="pass" placeholder="your Password " />
            <input type="button" value="LOGIN" id="button" onclick="checkLogin()" />
            <input type="range" min="0" max="100" value="20" name="range_name" />
        </div>

        <div data-role="footer" data-position="fixed">
            <h1> &copy; Nikhil </h1>
        </div>

    </div>
</body>
</html>





-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
2) SOURCE CODE FOR PHP SIDE:

   <?php
 
$conn=mysql_connect($servername,$username,$password)
mysql_select_db($databasename,$conn);

//$function_name=$_GET['jsonp'];

$a=$_GET['user'];

$pwd=$_GET['pass'];

$query="insert into mobilecheck  values('','$a','$pwd')";
$result=mysql_query($query);


?>

php code



 <?php    

 echo " welcome ";
                                            
 $conn=mysql_connect("mysql7.000webhost.com","a8678936_kishlay","nikhilnn2");
 $db= mysql_select_db("a8678936_aman",$conn);
 
 $function_name=$_GET['jsonp'];
 $a=$_GET['user'];
 $pwd=$_GET['pass'];

 $query="select * from member where user='$a' and pass='$pwd'";
 $result=mysql_query($query);
 $num=mysql_num_rows($result);


 //create json array
 $JSON_array=array();


 if($num>0)
 {
 $json_array['status']="true";                            
 }
 else
 {
 $json_array['status']="false";
 }

 //echo the json array
 echo "$fuction_name{";
   
 print json_encode($json_array);

 echo "}";
 ?>

Monday, 6 July 2015

navigation from one page to another

<!DOCTYPE html>
<!--
    Licensed to nikhil  
-->


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

        <meta name="viewport" content="width=device-width,initial-scale=1" >
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" >
        <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
       
        <script>
            function pagetwonav()
            {

                window.location.href = "#pagetwo";
                var r = document.getElementById("name").value;
                document.getElementById("show").innerHTML = r;

            }

        </script>
       </head>



    <body>
           <div data-role="page" id="pageone">
             <div data-role="header">
                  <h1> welcome  to page one</h1>
             </div>
           
            <div data-role="main" class="ui-content">
                <p>welcome </p>
                <a href="#pagetwo" data-transition="pop"> go to page 2</a>
                <input type="text" id="name" placeholder="your Name " />
                <input type="button"  value="go" id="button" onclick="pagetwonav()" />

                <ol data-role="listview">
                    <li> tea </li>
                    <li> coffee </li>
                </ol>
            </div>
              
         
             <div data-role="footer" data-position="fixed">
              <h1> &copy; Nikhil </h1>
            </div>
                         
           </div>




        <div data-role="page" id="pagetwo">
            <div data-role="header">
                <h1> welcome to page two</h1>
            </div>



            <div data-role="main" class="ui-content">
                <p>welcome to page 2</p>
                <a href="#pageone"> go to page 1</a>

                <div id="show">

                </div> 
            </div>




            <div data-role="footer" data-position="fixed">
                <h1> footer text for page 2</h1>
            </div>
        </div>


    </body>

</html>

Saturday, 4 July 2015

Mobile's side coding for check login (php excluded)

<!DOCTYPE html>
<html>
<head>
    <!-- Include meta tag to ensure proper rendering and touch zooming -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Include jQuery Mobile stylesheets -->
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <!-- Include the jQuery library -->
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <!-- Include the jQuery Mobile library -->
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
    <script>
 
        function pagetwonav() {
            window.location.href = "#pagetwo";
            var name = document.getElementById('naam').value;
            document.getElementById('showName').innerHTML=name
        }
 
        $(document).on("pagecreate","#pageone",function(){
            $("li").on("swipe", function () {
                $(this).hide();
            });
            $(document).on("scrollstart", function () {
           //     alert("you started scroling!!");
            });
        });
       
        function checkLogin()
        {
            var data = {
                user: document.getElementById("naam").value,
                pass: document.getElementById("mypass").value
            };
            $.getJSON("http://college9909.site90.net/desc.php?jsonp=?", data, function (data) {
                var status = JSON.stringify(data['status']);
                alert(status);
            }
            );
        }
       
 
    </script>
</head>
<body>
 
    <div data-role="page" id="pageone">
        <div data-role="header">
            <h1>Welcome To My Homepage</h1>
        </div>
 
        <div data-role="main" class="ui-content">
            <p>Welcome!</p>
            <a href="#pagetwo" data-transition="slide"> Navigate to page two</a>
            <input type="text" name="name" placeholder="Your Name" id="naam">
            <input type="password" name="pass" placeholder="Your password" id="mypass">
            <input type="button" value="Go" id="button" onclick="checkLogin()">
            <input type="range" min="0" max="100" value="20" name="range_name">
        </div>
       
        <div data-role="footer" data-position="fixed" style="background-color:#ff0000">
            <h1>&copy; Codeblix</h1>
        </div>
    </ol>
 
    <div data-role="page" id="pagetwo">
     
  •   <div data-role="header">
  •             <h1>Welcome </h1>
            </div>
     
            <div data-role="main" class="ui-content">
                <p>Welcome <div id="showName"></div></p>
     
            </div>
     
            <div data-role="footer" data-position="fixed">
                <h1>Footer Text for page 2</h1>
            </div>
        </div>
     
     
    </body>
      </html>

    Jquery mobile's ONSCROLL function

    <!DOCTYPE html>
    <html>
    <head>
        <!-- Include meta tag to ensure proper rendering and touch zooming -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- Include jQuery Mobile stylesheets -->
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
        <!-- Include the jQuery library -->
        <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
        <!-- Include the jQuery Mobile library -->
        <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
        <script>
     
            function pagetwonav() {
                window.location.href = "#pagetwo";
                var name = document.getElementById('naam').value;
                document.getElementById('showName').innerHTML=name
            }
     
            $(document).on("pagecreate","#pageone",function(){
                $("li").on("swipe", function () {
                    $(this).hide();
                });
                $(document).on("scrollstart", function () {
                    alert("you started scroling!!");
                });
            });
           
           
     
        </script>
    </head>
    <body>
     
        <div data-role="page" id="pageone">
            <div data-role="header">
                <h1>Welcome To My Homepage</h1>
            </div>
     
            <div data-role="main" class="ui-content">
                <p>Welcome!</p>
                <a href="#pagetwo" data-transition="slide"> Navigate to page two</a>
                <input type="text" name="name" placeholder="Your Name" id="naam">
                <input type="button" value="Go" id="button" onclick="pagetwonav()">
            </div>
            <ul data-role="listview" >
                <li>tea</li>
                <li>coffee</li>
                <li>tea</li>
                <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li><li>tea</li>
    <li>coffee</li>
                </ul>
     
            <div data-role="footer" data-position="fixed" style="background-color:#ff0000">
                <h1>&copy; Codeblix</h1>
            </div>
        </ol>
     
        <div data-role="page" id="pagetwo">
            <div data-role="header">
                <h1>Welcome </h1>
            </div>
     
            <div data-role="main" class="ui-content">
                <p>Welcome <div id="showName"></div></p>
     
            </div>
     
            <div data-role="footer" data-position="fixed">
                <h1>Footer Text for page 2</h1>
            </div>
        </div>
     
     
    </body>
      </html>

    Friday, 3 July 2015

    How to make branch ,clone , push, pull and merge in Github


    1) GIT COMMAND TO SEE ,HOW MANY  BRANCHES ARE THERE :
         $ git  branch

    2) GIT COMMAND  TO MAKE  A NEW  BRANCH :

       $ git branch "ur branch name"

    3) GIT COMMAND TO SWITCH  TO SOME OTHER BRANCH :

      $ git checkout  "my_branch"                 (this command will take me to branch- my_branch)


    4) GIT COMMAND  TO  DO  CLONE  OF SOME  OTHER'S  OR YOUR OWN'S PROJECT
         WE  JUST  NEED  THE  SSH  CODE OF THAT REPOSITORY:

     $ git clone "SSH URL"



    5)  GIT  COMMAND  TO  PUSH  IN SOME OTHER BRANCH

       $ git remote add "variable_name" "SSH URL"
      $ push "variable_name" "branch_name"


    6) GIT COMMAND  TO  PULL  SOME BRANCH (before pushing ,it is recommended to pull)
     
       $ git pull "variable" master


    7) GIT COMMAND TO MERGE
     
      $ git merge master

    Thursday, 2 July 2015

    how to do databse connection in php


    $conn=mysql_connect($servername,$username,$password)
    mysql_select_db($databasename,$conn);

    Telerik swipe scroll (Hybrid app)



    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

        <meta name="viewport" content="width=device-width,initial-scale=1">
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
        <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

        <script>
            function pagetwonav()
            {
      
                var p = document.getElementById("pass").value;
                var pas = "password";
                if(p==pas)
                {
                    window.location.href = "#pagetwo";
                    var r = document.getElementById("name").value;
                    document.getElementById("show").innerHTML = "welcome "+r;
                }
                else
                {
                    window.location.href = "#pageone";
                    //document.getElementById("mess").style.display = "block";
                    document.getElementById("mess").innerHTML="your password is incorrect";
                }

            }


    /*
            $(document).on("pagecreate","#pageone".function() {
             {                                      // oncreating pageone function is called
                                                   // in tab alert will occur
             $("div").on("tap",function()
             { alert("You have tapped!");  });

             
            });
        */



            $(document).on("pagecreate", "#pageone", function () {
                $("li").on("swipe", function () {
                    $(this).hide();
                });
                $(document).on("scrollstart", function () {
                    alert("you started scroling!!");
                });
            });



            
        </script>
    </head>




    <body>
        <div data-role="page" id="pageone">
            <div data-role="header">
                <h1>page 1</h1>
            </div>

            <div id="mess" >

            </div>

            <div data-role="main" class="ui-content">
                <p> LOGIN PAGE </p>
                Username : <input type="text" id="name" placeholder="your Name " />
                Password : <input type="password" id="pass" placeholder="your Password " />
                <input type="button" value="LOGIN" id="button" onclick="pagetwonav()" />
                <input type="range" min="0" max="100" value="20" name="range_name" />
            </div>

            <ol>
                <li> tea </li>
                <li> coffee</li>
            </ol>

            <div data-role="footer" data-position="fixed">
                <h1> &copy; Nikhil </h1>
            </div>

        </div>




        <div data-role="page" id="pagetwo">
            <div data-role="header">
                <h1> welcome to page two</h1>
            </div>



            <div data-role="main" class="ui-content">
                <p>welcome to page 2</p>
                <a href="#pageone"> go to page 1</a>

                <div id="show">

                </div>
            </div>




            <div data-role="footer" data-position="fixed">
                <h1> footer text for page 2</h1>
            </div>
        </div>


    </body>

    </html>

    Saturday, 27 June 2015

    how to connect ur PC with github so as to push ur projects to github.



     HOW  TO  CONNECT  UR  PC  WITH  GITHUB  SO AS TO  PUSH  UR  PROJECT  TO GITHUB.

    Best link to learn github (push) :- www.howtoforge.com/tutorial/install-git-and-github-on-ubuntu-14.04/

    Best Link to learn (pull) :- https://help.github.com/articles/importing-a-git-repository-using-the-command-line/

    STEPS :-

    1)  GENERATE THE .SSH KEYS (ONE PUBLIC AND ONE PRIVATE).

         $ ssh -keygen -t  rsa  -C  "uremailid.com"

         $ ssh  -T git@github.com     ( command for connection testing )

    2)  ENTER THE PUBLIC KEY  IN  GITHUB (in ur account ) .

            NOW CONNECTION  HAS BEEN MADE :)

    3) now, WE WILL  ADD  OUR  PROJECTS  TO  GITHUB.

           $ git  remote add  origin  git@github.blah__blah__ydsushj.git

          (here git@github.blah__blah__ydsushj.git    is   the  name  of  ur repository  in github ,, u named it
           temporarily  as  "origin ". Here "origin" is just a variable ).

    4) now final stage push ur project.

        $ git push origin master .









    Thursday, 25 June 2015

    How to install and use GitBash (command line version of Git) in windows


    Link imporatnt       https://help.github.com/articles/generating-ssh-keys/
    DOWNLOAD  gitbash ( command line version of Git )

    1) download from https://git-scm.com/download/win

    2) after installing ,configure the path of the project folder 
    gitbash-->> properties-->> startin: 

    3) create a folder in that folder named git projects

    4) by using command -->> ( $ git project init gitproject )  gitproject 
    folder become the master folder