Friday, 6 September 2019

edit


<?php
$con=mysqli_connect("localhost","root","","myschool");
$sql="SELECT * FROM school";
$result=mysqli_query($con,$sql);
if($result)
{
          echo "Now You can access data";
}
   if(mysqli_num_rows($result)>0 )
{
?>
<html>
<head>
<link rel="stylesheet" href="table.css">
</head>
<body>
<form  method="POST" action="<?php $_PHP_SELF ?>">
<table border="2" align="center">

<tr><caption>Students details</caption></tr>
<tr><th>RollNo.</th>
<th>Student_Name</th>
<th>Father_Name</th>
<th>Class.</th>
<th>Gender</th>
<th>Course</th>
<th>Update</th>
<th>Delete</th></tr>
<?php
while($row= mysqli_fetch_assoc($result))
          {
?>
<tr><td ><?php echo $row['ID']; ?></td>
<td><?php echo $row['s_name'];?> </td>
<td><?php echo $row['F_name'];?> </td>
<td><?php echo $row['Class']; ?></td>
<td><?php echo $row['Gender'];?> </td>
<td><?php echo $row['Cource'];?> </td>
<?php echo "<td><a href=' edi3.php?ID=".$row['ID']."'>Update</a></td>";?>
<?php echo "<td><a href=' del.php?id=".$row['ID']."'>del</a></td>";?>
 <?php }}?>
</tr>
</table>
</form>
</body>
</html>

Edi3.php
<?php
#require('con1.php');
$conn= new mysqli("localhost","root","","myschool");

if (!$conn) {

    die("Connection failed: " . mysqli_connect_error());
}
else
{

$ID=$_REQUEST['ID'];
$query = "SELECT * from school where ID='".$ID."'";
$result = mysqli_query($conn, $query) or die ( mysqli_error());
$row = mysqli_fetch_assoc($result);
}
?>

<html>
<head>

<title>Update Record</title>

</head>
<body>

<h1>Update Record</h1>
<?php
$status = "";
if(isset($_POST['new']) && $_POST['new']==1)
{
$ID=$_REQUEST['ID'];

$name =$_REQUEST['name'];

$update="update school set s_name='".$name."' where ID='".$ID."'";
mysqli_query($conn, $update) or die(mysqli_error());
$status = "Record Updated Successfully. </br></br>
<a href='STUDENT.php'>View Updated Record</a>";
echo '<p style="color:#FF0000;">'.$status.'</p>';
}else {
?>
<div>
<form name="form" method="post" action="">
<input type="hidden" name="new" value="1" />
<input name="ID" type="hidden" value="<?php echo $row['ID'];?>" />
<p><input type="text" name="name" placeholder="Enter Name"
required value="<?php echo $row['s_name'];?>" /></p>

<p><input name="submit" type="submit" value="Update" /></p>
</form>
<?php } ?>
</div>
</div>
</body>
</html>

Saturday, 31 August 2019

fetch data by mysql


<?php
$con=mysqli_connect("localhost","root","","myschool");
if (isset($_POST['submit']))
{
$name=$_POST['n1'];
$fname=$_POST['f1'];
$gen=$_POST['g1'];
$class=$_POST['cla'];
$cource="";
$lat=$_POST['lat'];
$longt=$_POST['longt'];
if(!empty($_POST['c1'])){
foreach($_POST['c1'] as $selected){
$cource.= $selected.",";
}
}
$sql="INSERT INTO school(s_name,F_name,Class,Gender,Cource,Lat,Longt)VALUES('$name','$fname','$class','$gen','$cource','$lat','$longt')";

$qu=mysqli_query($con,$sql);
if($qu)
{
          echo "data inserted";
}
else
{
          echo mysqli_error($con);
}
}
?>

Friday, 30 August 2019

data inserted in mysql

<?php
$con=mysqli_connect("localhost","root","","myschool");
if (isset($_POST['submit']))
{
$name=$_POST['n1'];
$fname=$_POST['f1'];
$gen=$_POST['g1'];
$class=$_POST['cla'];
$cource="";
$lat=$_POST['lat'];
$longt=$_POST['longt'];

if(!empty($_POST['c1'])){

foreach($_POST['c1'] as $selected){
$cource.= $selected.",";
}
}
$sql="INSERT INTO school(s_name,F_name,Class,Gender,Cource,Lat,Longt)VALUES('$name','$fname','$gen','$class','$cource','$lat','$longt')";

$qu=mysqli_query($con,$sql);

if($qu)
{
echo "data inserted";
}

else
{
echo mysqli_error($con);
}
}

?>

data inserted in another page


Some changes in form.php presented by
different color
<html>
<head>
<link rel="stylesheet"  href="admission.css">
</head>
<body>

<p id="place"></p>
<script>
var x = document.getElementById("place");

function getLocation() {
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
  } else {
    x.innerHTML = "Geolocation is not supported by this browser.";
  }
}

function showPosition(position) {
  x.innerHTML = "Latitude: " + position.coords.latitude +
  "<br>Longitude: " + position.coords.longitude;
}
</script>
<form  method="POST" action="form inserted.php"  >
<table frame="box" align="center">
<tr><td>Name</td><td><input type ="text" name="n1"></td></tr>
<tr><td>F_Name</td><td><input type ="text" name="f1"></td></tr>
<tr><td>Class</td><td><select name="cla">
<option>8th</option>
<option>9th</option>
<option>10th</option>
</select>

</td></tr>
<tr><td>Gender</td></tr>
<tr><td><input type="radio" name="g1"value="male">Male</td></tr>
<tr><td><input type="radio" name="g1" value="female">Female</td></tr>
<tr><td>Cources:</td></tr>
<tr><td ><input type="checkbox" name="c1[]"  id="c1" value="Cricket">Cricket</td></tr>
<tr><td ><input type="checkbox" name="c1[]"   id="c1" value="Football">Football</td></tr>
<tr><td>Latitued</td><td><input type="text"></td><td>Longitude</td><td><input type="text"></td></tr>


<tr><td><button onclick="getLocation()">get Location</button></td></tr>


<tr><td><input type="submit" name="submit"></td></tr>

</table>
</form  >
<p id="place"></p>
</body>
</html>
Form inserted.php
<?php
if (isset($_POST['submit']))
{
$name=$_POST['n1'];
$fname=$_POST['f1'];
$gen=$_POST['g1'];
$class=$_POST['cla'];

echo $name."<br>";
echo $fname."<br>";
echo $class."<br>";
echo $gen."<br>";
if(!empty($_POST['c1'])){
foreach($_POST['c1'] as $selected){
echo $selected."</br>";
}
}

}

?>


Tuesday, 27 August 2019

Jquery-1

<html>
<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">?</script>
<script>
$(document).ready(function(){
  $("p").click(function(){
    $(this).hide();
  });
});
</script>
</head>
<body>

<p>Hello , I will disappear by click.</p>
<p>I M also disappear!</p>
<p>You are also disapear!</p>

</body>
</html>

drag drop in javascript


<html>
<head>
<style>
#div1 {
  width: 350px;
  height: 70px;
  padding: 10px;
  border: 1px solid #aaaaaa;
}
</style>
<script>
function allowDrop(ev) {
  ev.preventDefault();
}

function drag(ev) {
  ev.dataTransfer.setData("text", ev.target.id);
}

function drop(ev) {
  ev.preventDefault();
  var data = ev.dataTransfer.getData("text");
  ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>

<p>Drag the Hawamahal image into the rectangle:</p>

<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<br>

<p>Drag the Nahargarh image into the rectangle:</p>

<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<br>

<img id="drag1" src="Hawamahal.jpg" draggable="true" ondragstart="drag(event)" width="336" height="69">

<img id="drag2" src="nahargarh.jpg" draggable="true" ondragstart="drag(event)" width="336" height="69">

<img id="drag3" src="ajmer fort.jpg" draggable="true" ondragstart="drag(event)" width="336" height="69">

</body>
</html>


html css javascript-2


<html>
<head>
<link rel="stylesheet"  href="admission.css">
</head>
<body>

<p id="place"></p>
<script>
var x = document.getElementById("place");

function getLocation() {
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
  } else {
    x.innerHTML = "Geolocation is not supported by this browser.";
  }
}

function showPosition(position) {
  x.innerHTML = "Latitude: " + position.coords.latitude +
  "<br>Longitude: " + position.coords.longitude;
}
</script>

<table frame="box" align="center">
<tr><td>Name</td><td><input type ="text"></td></tr>
<tr><td>F_Name</td><td><input type ="text"></td></tr>
<tr><td>Class</td><td><select>
<option>8th</option>
<option>9th</option>
<option>10th</option>
</select>

</td></tr>
<tr><td>Gender</td></tr>
<tr><td><input type="radio" name="g1">Male</td></tr>
<tr><td><input type="radio" name="g1">Female</td></tr>
<tr><td>Cources:</td></tr>
<tr><td ><input type="checkbox" name="c1" >Cricket</td></tr>
<tr><td ><input type="checkbox" name="c1" >Football</td></tr>
<tr><td>Latitued</td><td><input type="text"></td><td>Longitude</td><td><input type="text"></td></tr>
<tr><td><button onclick="getLocation()">get Location</button></td></tr>

<tr><td><input type="submit" name="submit"></td></tr>

</table>
<p id="place"></p>
</body>
</html>
Admission.css
table{
          background-color:pink;
          padding:20px;
}
table td
{
          padding:18px;
}
body
{
          background-color:red;
}
#place
{
          top:85%;
          position:absolute;
          background-color:green;
}

Monday, 26 August 2019

javascript function

<html>
<body>

<h2>JavaScript Functions</h2>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML =sum(5) ;

function sum(a) {
 return a+8;
}
</script>

</body>
</html>


calculator

<html>
<form name="calc">
<table border=4>
<tr>
<td>
<input type="text" name="text" size="18">
<br>
</td>
</tr>
<tr>
<td>
<input type="button" value="1" onclick="calc.text.value += '1'">
<input type="button" value="2" onclick="calc.text.value += '2'">
<input type="button" value="3" onclick="calc.text.value += '3'">
<input type="button" value="+" onclick="calc.text.value += ' + '">
<br>
<input type="button" value="4" onclick="calc.text.value += '4'">
<input type="button" value="5" onclick="calc.text.value += '5'">
<input type="button" value="6" onclick="calc.text.value += '6'">
<input type="button" value="-" onclick="calc.text.value += ' - '">
<br>
<input type="button" value="7" onclick="calc.text.value += '7'">
<input type="button" value="8" onclick="calc.text.value += '8'">
<input type="button" value="9" onclick="calc.text.value += '9'">
<input type="button" value="*" onclick="calc.text.value += ' * '">
<br>
<input type="button" value="c" onclick="calc.text.value = ''">
<input type="button" value="0" onclick="calc.text.value += '0'">
<input type="button" value="=" onclick="calc.text.value = eval(calc.text.value)">
<input type="button" value="/" onclick="calc.text.value += ' / '">
<br>
</td>
</tr>
</table>
</form>
</html>

Friday, 23 August 2019

html css javascript-1



<html>
<head>
  <link rel="stylesheet" href="des2.css">
</head>
<body bgcolor="mahroon">

<div class="inline">
<div></div>
<div></div>
<div></div>
</div>
<div  class="inline">
<h1 align="center" ><mark>Welcome to learn Technology</mark></h1><br>
</div>

<div id="left">

<font size="8"> &nbsp;<a href="STUDENT.HTML">students</a><br><br><br>
&nbsp;&nbsp;<a href="faculty.html">faculty</a><br><br><br>
&nbsp;&nbsp;<a href="*.html">department</a><br><br><br>
&nbsp;&nbsp;<a href="form.html">admission</a><br><br><br>
&nbsp;&nbsp;<a href="*.html">cources</a><br><br><br>
&nbsp;&nbsp;<a href="*.html">contact us</a></font>


</div>
<div id="navbar">
  <a  href="#">Home</a>
  <a href="#">Search</a>
  <a href="#">Contact</a>
  <a href="#">Login</a>
 
</div>
<!--<a href="*.html">Admission</a>&nbsp;&nbsp;
<a href="*.html">Contact-Us</a>&nbsp;&nbsp;
<a href="*.html">Career</a> -->

<div id="right">
<p >
  A unique platform  to learn IT technology in simple and easy language. daily day by day tutorial is available.
  web site teaches you through making website while learning php.</p>
  <button type="button"
onclick="document.getElementById('clock').innerHTML = Date()">Time</button>
<p id="clock">
  </p>
<p id="profile"></p>
<button type="button" onclick='document.getElementById("profile").innerHTML = "<pre>Name: Pragya Singh"'>Profile</button>
 </div>
</body>
</html>
Add code in des2.css
#clock
{
        font-size:25px;
        color:blue;
        background-color:black;
}
 In html in place of
<p id="profile"></p>
<button type="button" onclick='document.getElementById("profile").innerHTML = "<pre>Name: Pragya Singh"'>Profile</button>
You can
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>

Cources.html
<html>
<body>
<h1 align="center">
<table align="center" bgcolor="lightgreen" border="1">
<tr><th>Cources</th><th>Tution-Fees</th><th>Caution-Fees</th></tr>
<tr><td>Olevel</td><td><input type="text" name="v1" value="500"></td><td><input type="text" name="c1" value="200"></td></tr>
<tr><td>RSCIT</td><td><input type="text" name="v2" value="600"></td><td><input type="text" name="c2" value="300"></td></tr>
<tr><td>English</td><td><input type="text" name="v3" value="500"></td><td><input type="text" name="c3" value="100"></td></tr>
<tr><td>Electricity</td><td><input type="text" name="v4" value="700"></td><td><input type="text" name="c4" value="300"></td></tr>
</table>

</body>
</html>
Some changes in this cource.html for javascript
<html>
<body>
<h1 align="center">
<table align="center" bgcolor="lightgreen" border="1">
<tr><th>Cources</th><th>Tution-Fees</th><th>Caution-Fees</th><th>Total-Fees</th></tr>
<tr><td>Olevel</td><td><input type="text" name="v1" value="500"></td><td><input type="text" name="c1" value="200"></td>
<td id="olevel">
<button type="button" onclick="document.getElementById('olevel').innerHTML= 500+200 ">Total Fees</button></td></tr>
<tr><td>RSCIT</td><td><input type="text" name="v2" value="600"></td><td><input type="text" name="c2" value="300"></td>

<td >

<button type="button" onclick="document.write(600+300) ">Total Fees</button></td></tr>
<tr><td>English</td><td><input type="text" name="v3" value="500"></td><td><input type="text" name="c3" value="100"></td>
<td >

<button type="button" onclick="window.alert( 500+100) ">Total Fees</button></td></tr>
<tr><td>Electricity</td><td><input type="text" name="v4" value="700"></td><td><input type="text" name="c4" value="300"></td>
<td >press ctl+shift+j
<script>
console.log(700 + 300);
</script></td>
</tr>
</table>

</body>
</html>


Wednesday, 21 August 2019

html project-4


<html>
<head>
<link rel="stylesheet"  href="admission.css">
</head>
<body>

<table frame="box" align="center">
<tr><td>Name</td><td><input type ="text"></td></tr>
<tr><td>F_Name</td><td><input type ="text"></td></tr>
<tr><td>Class</td><td><select>
<option>8th</option>
<option>9th</option>
<option>10th</option>
</select>

</td></tr>
<tr><td>Gender</td></tr>
<tr><td><input type="radio" name="g1">Male</td></tr>
<tr><td><input type="radio" name="g1">Female</td></tr>
<tr><td>Cources:</td></tr>
<tr><td ><input type="checkbox" name="c1" >Cricket</td></tr>
<tr><td ><input type="checkbox" name="c1" >Football</td></tr>
<tr><td><input type="submit" name="submit"></td></tr>
</table>
</table>
</body>
</html>
Admission.css
table{
          background-color:pink;
          padding:20px;
}
table td
{
          padding:18px;
}
body
{
          background-color:red;
}

Tuesday, 20 August 2019

html project-4


Faculty.html
<html>
<head>
<link rel="stylesheet" href="faculty.css">
</head>
<body>
<table  border="2"align="center">
<caption>Faculty Profile</caption>
<tr><th>S.No.</th>
<th>Faculty_Name</th>
<th>Qualification.</th>
<th>Reserch</th>
<th>Update</th>
<th>delete</th></tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td></tr>
</table>


</body>
</html>
Faculty.css
body
{
          background-color:red;
}
table
{
          top:5px;
          background-color:green;
          font-size:25px;
          padding:20px;
          border:2px;
}
table caption{
          background-color:yellow;
color:red;
font-size:30px;
}
table th
{
          padding:25px;
}
table td
{
          padding:25px;
}