0% found this document useful (0 votes)
5 views9 pages

php5,7,14,18 A

The document contains multiple HTML and PHP files that implement various functionalities such as student name search, project title search, user validation, and distance conversion. Each PHP script connects to a MySQL database to retrieve or manipulate data based on user input. The JavaScript functions in the HTML files facilitate asynchronous requests to these PHP scripts for dynamic content updates.

Uploaded by

sagarmeravi3616
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views9 pages

php5,7,14,18 A

The document contains multiple HTML and PHP files that implement various functionalities such as student name search, project title search, user validation, and distance conversion. Each PHP script connects to a MySQL database to retrieve or manipulate data based on user input. The JavaScript functions in the HTML files facilitate asynchronous requests to these PHP scripts for dynamic content updates.

Uploaded by

sagarmeravi3616
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Slip5B.

html

<html>

<head>

<script type="text/javascript" >

function display()

n=f1.txt.value;

var xmlhttp;

if (window.XMLHttpRequest)

xmlhttp=new XMLHttpRequest;

else

xmlhttp=new ActiveXObject("Microsoft.xmlhttp");

xmlhttp.onreadystatechange=function()

if(xmlhttp.readyState==4 && xmlhttp.status==200)

document.getElementById("result").innerHTML=xmlhttp.responseText;

};

xmlhttp.open("GET","slip5B.php?txt="+ n,true);

xmlhttp.send();

</script>

</head>

<body>

<form name="f1">

Enter Student Name:

<input type="text" name="txt" onkeyup="display()"/><br>


</form>

<div id="result"></div>

</body>

</html>

slipB.php
<?php

$name=$_GET['txt'];

$host='localhost';

$user='root';

$pass='';

$db='advancephp';

$mysqli=new mysqli($host,$user,$pass,$db);

if($mysqli->connect_errno)

die('Database connection error:'.mysqli_error());

$mysqli->select_db($db);

if($result=$mysqli->query("SELECT DATABASE()"))

$row=$result->fetch_row();

echo "default database is".$row[0];

$result->close();

$query="select * from student where sname='$name'";

$result=$mysqli->query($query);

if(mysqli_num_rows($result)>0)

echo"<table>";
echo"<tr>";

echo "<th> Student No </th>";

echo "<th> Student name </th>";

echo "<th> Standard </th>";

echo "<th> Student Marks </th>";

echo "<th> Student Persentage </th>";

echo"</tr>";

while($row=mysqli_fetch_array($result))

echo "<tr>";

echo "<td>" .$row['sno'] ."</td>";

echo "<td>" .$row['sname']."</td>";

echo "<td>" .$row['std']."</td>";

echo "<td>" .$row['marks']."</td>";

echo "<td>" .$row['per']."</td>";

echo "</tr>";

echo"</table>";

mysqli_free_result($result);

else

echo"no records found for the given match.";

$mysqli->close();

?>

Slip7B.html
<html>

<body>

<form action="Slip7B.php" method="get">


<b>Enter the title of project :: </b><input type="text" name="ptitle"><br>

<input type=submit value=SUBMIT>

</form>

</body>

</html>

Slip7B.php
<?php

$ptitle = $_GET['ptitle'];

$con=mysqli_connect("localhost","root","","slip7bdatabase");

$q=mysqli_query($con,"select s_name from student,project where project_title='$ptitle'


&&student.p_group_no=project.p_group_no");

echo "Student Name :<br>";

while($row = mysqli_fetch_array($q))

echo $row['s_name'];

mysqli_close($con);

?>
Slip14B.html

<html>

<head>

<script type="text/javascript">

function validation()

var ob=false;

ob=new XMLHttpRequest();

var nm=document.getElementById("nm").value;

var pass=document.getElementById("pass").value;

ob.open("GET","slip14B.php?nm="+nm+"&pass="+pass);

ob.send();

ob.onreadystatechange=function()

if(ob.readyState==4 && ob.status==200)

document.getElementById("val").innerHTML=ob.responseText;

</script>

</head>

<body>

Enter User Name :<input type=text id="nm"><br><br>

Enter Password :<input type=text id="pass"><br><br>

<input type=button name=submit value=validate onClick="validation()">

<span id="val"></span>

<body>

</html>
Slip14B.php
<?php

$una=$_GET['nm'];

$ps=$_GET['pass'];

$sn="localhost";

$un="root";

$pas="";

$dbn="advancephp";

if((!empty($una)) && (!empty($ps)))

$con=mysqli_connect($sn,$un,$pas,$dbn);

$sql="select * from login where un='$una' and pass='$ps'";

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

if (mysqli_num_rows($r) > 0)

echo "Login";

else

echo "Not";

else

echo "enter both Username& pass";

?>

Slip17A.php
<?php

echo"<table border=1>";

foreach($_SERVER as $a=>$b)

echo"<tr><td>".$a."</td><td>".$b."</td></tr>";

echo"</table>";

?>

Slip18A.php
<html>

<head>

<title>Distance Conversion</title>

<body>

<form action="<?php echo$_SERVER['PHP_SELF']?>" method="POST">

<table>

Enter Distance in meter :<input type=text name=t1><br>

<input type=radio name=r1 value=1>Convert into Centimeter<br>

<input type=radio name=r1 value=2>Convert into Kilometer<br>

<input type=submit value=Convert><br>

</form>

</table>
<?php

if($_SERVER['REQUEST_METHOD']=='GET')

////////...................///////

else if($_SERVER['REQUEST_METHOD']=='POST')

$dist=$_POST['t1'];

$op=$_POST['r1'];

switch($op)

case 1:

echo "Conversion from meter to centimeter is :";

$cm=$dist*100;

echo "$cm cm";

break;
case 2:

echo "Conversion from meter to Kilometer is :";

$km=$dist/1000;

echo "$km km";

break;

?>

</body>

</html>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy