Friday, 20 January 2017

Examplre of Inner Join function in mysql

  1. SELECT foods.item_name,foods.item_unit,  
  2. company.company_name, company.company_city  
  3. FROM foods ,company  
  4. WHERE  foods.company_id =company.company_id  
  5. AND company.company_city='London';

Wednesday, 11 January 2017

Jquery With Animation

jquery with animation

<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
<style>
.animation{
 width:300px;
 height:300px;
 border:#000 thin solid;
 background-color:#903;
 border-radius:50px;
 position:relative;
}
input{
 background-color:#FF0;
 margin:20px;
 padding:20px;
 border:#999 thin solid;
 border-radius:50px;
}

</style>

<script src="../jquery-classes/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){

 var anim = $('.animation');

 $('#animation').click(function(){
 anim.animate({
  left:'600px',
  opacity:'0.7',

  });

  anim.animate({
  top:'300px',
  opacity:'0.5',

  });

  anim.animate({
  left:'0px',
  opacity:'0.1',

  });

  anim.animate({
  top:'0px',
  opacity:'1',

  });
 });
});

</script>



<body>
  <div class="animation">
  jquery animation<br />

  </div>
<input id="animation" type="button" value="Click To Animate" />

</body></div>

The Basic Input Field of Login Page

Input field in login page

<body>
<form method="post" action="#"><pre>
E-mail<input type="email" name="email" id="email" /><br />

Password<input type="password" name="password" id="pwd" /><br />
<input type="submit" name="n" value="submit"  />

</pre></body>

Monday, 9 January 2017

Make the Dashboard Using Mysql

<body>
<table border="1">

<?php

if(isset($_SESSION["useremail"])){
$unm = $_SESSION["useremail"];
$qr = "select * from submit where email = '$unm' ";
$rs = mysql_query($qr);
$num = mysql_num_rows($rs);


?>
        <tr>
        <td>Name</td>
        <td>Surname</td>
        <td>Email id</td>
        <td>password</td>
        <td>Gender</td>
        <td>Phone</td>
        <td>Address</td>
        <td>File</td>
        <td>agree</td>
        <td>delete</td>
        <td>Logout</td>
        <td>Update</td>
     
        </tr>
        <?php
if ($num > 0){
while ($row = mysql_fetch_array($rs)){ ?>

                <tr>
                <td><?php echo $row["name"]; ?></td>
                <td><?php echo $row["surname"]; ?></td>
                <td><?php echo $row["email"]; ?></td>
                <td><?php echo $row["password"]; ?></td>
                <td><?php echo $row["gender"]; ?></td>
                <td><?php echo $row["phone"]; ?></td>
                <td><?php echo $row["address"]; ?></td>
                <td><?php echo $row["file"]; ?></td>
                <td><?php echo $row["agree"]; ?></td>
                 <td><a href="dashboard.php?del=<?php echo $row['id'];?>">delete</a></td>
                 <td><a href="dashboard.php?logout=0">Logout</a></td>
                 <td><a href="dashboard.php?upt=<?php echo $row['id'];?>">update</a></td>
               
                </tr>
               
<?php }} }?>

</table>


       
</body>

Beautiful Logo

This is my frist LOGO



Example of Super Global Request

<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
  Name: <input type="text" name="fname">
  <input type="submit">
</form>

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // collect value of input field
    $name = $_REQUEST['fname'];
    if (empty($name)) {
        echo "Name is empty";
    } else {
        echo $name;
    }
}
?>

</body>

Simple Method of Sort Array

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body><?php
$s = date("D");
switch($s){
case"sunday";
echo"today is sunday";
break;
default;
echo"$s";
}
?>
<br />

<?php
$cars = array("Volvo", "BMW", "Toyota");
rsort($cars);

$clength = count($cars);
 echo"$clength";
 ?>
 <br />

 <?php
 $car = array("bat", "cat", "dot");
 echo $car[$x];
 asort($car);

 $clength  = count($car);
 for($x = 0 ;$x < $length; $x++){
 echo $car[$x];
 echo"<br>";
 }
 ?>
</body>
</html>

How to use php validation

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<?php
// define variables and set to empty values
$name = $email = $gender = $comment = $website = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
  $name = test_input($_POST["name"]);
  $email = test_input($_POST["email"]);
  $website = test_input($_POST["website"]);
  $comment = test_input($_POST["comment"]);
  $gender = test_input($_POST["gender"]);
}

function test_input($data) {
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  return $data;
}
?>

<h2>PHP Form Validation Example</h2>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
  Name: <input type="text" name="name">
  <br><br>
  E-mail: <input type="text" name="email">
  <br><br>
  Website: <input type="text" name="website">
  <br><br>
  Comment: <textarea name="comment" rows="5" cols="40"></textarea>
  <br><br>
  Gender:
  <input type="radio" name="gender" value="female">Female
  <input type="radio" name="gender" value="male">Male
  <br><br>
  <input type="submit" name="submit" value="Submit">
</form>

<?php
echo "<h2>Your Input:</h2>";
echo $name;
echo "<br>";
echo $email;
echo "<br>";
echo $website;
echo "<br>";
echo $comment;
echo "<br>";
echo $gender;
?>
</body>
</html>

Tuesday, 1 November 2016

how to make image slide in jquery with html or css

<html>
<head>
<style>
body{
margin:0px 0px 0px 0px;
}
  .header{
 background-color:#006;
 height:100%;
 width:100%;
 position:fixed;
  }
  .image,.image1{
 background-image:url(earth.jpg);
 height:150px;
 width:150px;
 border:#333 thin solid;
 border-radius:100px;
 margin-left:44%;
 margin-top:-90px;
 position:relative;
  }
  .image1{
 margin-top:360px;
  }

  .imageleft{
 background-image:url(earth.jpg);
 height:200px;
 width:200px;
 border:#333 thin solid;
 border-radius:100px;
 margin-top:-450px;
 float:left;
 position:relative;
  }
.imageright{
float:right;
margin-top:-450px;
background-image:url(earth.jpg);
 height:200px;
 width:200px;
 border:#333 thin solid;
 border-radius:100px;
 position:relative;
}

#submmit{
margin-top:50px;
background-color:#F00;
border:#666 thin solid;
border-radius:50px;
padding:10px;
}

</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script src="../jquery-classes/jquery.js"></script>
<script>
$(document).ready(function(){

var anim = $('.image'); var anim1 = $('.image1'); var anim2 = $('.imageleft');   var anim3 = $('.imageright');
anim.mouseenter(function(){

anim.animate({
top:'150px',
},2000);

anim.animate({
top:'0px',
},2000);
});


anim.mouseenter(function(){
anim1.animate({
top:'-180px',
},2000);

anim1.animate({
top:'0px',
},2000);


anim.mouseenter(function(){
anim2.animate({
right:'-420px',
},2000);

              anim2.animate({
right:'0px',
},2000);
});

 anim.mouseenter(function(){
anim3.animate({
right:'430px',
},2000);
 anim3.animate({
right:'0px',
},2000);

 });
});
});

</script>
</head>

<body>

<div class="header">
    <input type="button" value="click here" id="submmit"  />
 
    <div class="image">
         </div>

<div class="image1"></div>
         
            <div class="imageleft"></div>
             <div class="imageright"></div>

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

Saturday, 1 October 2016

how to make login page using session kookies mysql all in one

 How to make a login page using mysql , session , cookies , in php 

itis is a very simple method see below

<head>

<?php
session_start();
mysql_connect("localhost","root","");
mysql_select_db("form");
if (isset($_POST["btn"])){

$email = $_POST["n3"];
$password = $_POST["n4"];

if (isset($_POST["btn"])){
setcookie("email",$em,time()+60);
setcookie("password",$pa,time()+60);
}

$q = "select * from submit where email = '$email' && password ='$password' ";
$sr = mysql_query($q);
$num = mysql_num_rows($sr);

if($num > 0){

$row = mysql_fetch_array($sr);

if ($row["email"] == $email && $row ["password"] == $password ) {
$_SESSION ["useremail"] = $email;
header("location:dashboard.php");
}
}
}

?>

</head>

<body>

  <div class="wraper" >
        <div class="logout">
       <p align="center"> <a href="">LOGOUT</a></p>
        </div>
        <div class="header">
        <div class="menu">
<form method="post" ><b><h2><pre>
        email : <input type="email" name="n3"  /><br />
     Password : <input type="password" name="n4"  /><br />
                 <input type="submit" name="btn" value="submit" />
               
                 <a href="">forget password</a>
       
    </pre>     </h2>
         </b></form>

</div>
</div>

</div>
</body>