User:NARAYANNN
emp1.php
<html>
<body>
<form method="POST" action="emp2.php">
Employee Number:<input type="text" name="Eno">
Employee Name:<input type="text" name="Ename">
Employee Address:<input type="text" name="Address">
<input type="submit" name="submit" value="submit">
</form> </body> </html>
emp2.php
<?php session_start(); $_SESSION['Eno']=$_POST['Eno']; $_SESSION['Ename']=$_POST['Ename']; $_SESSION['Address']=$_POST['Address'];;
?>
<html>
<body>
<form method="POST" action="emp3.php">
Basic:<input type="text" name="Basic">
DA:<input type="text" name="DA">
HRA:<input type="text" name="Hra">
<input type="submit" name="submit" value="submit">
</form> </body> </html>
emp3.php
<?php session_start();
$basic=$_POST['Basic']; $da=$_POST['DA']; $hra=$_POST['Hra'];
echo "
";
echo "
Name:".$_SESSION['Eno'];;
echo "
Eno:".$_SESSION['Ename'];
echo "
Address:".$_SESSION['Address'];
echo "
Basic:".$basic;
echo "
Da:".$da;
echo "
Hra:".$hra;
$total=$basic+(($basic*$da)/100)+(($basic*$hra)/100);
echo "
Total Earning is :".$total;
?>
employee.php
<?php
$xml=simplexml_load_file("employee.xml");
foreach($xml->employee as $emp)
{
echo "Employee No=$emp->empno"."
";
echo "Employee Name=$emp->empname"."
";
echo "Employee Salary=$emp->salary"."
";
echo "Employee Designation=$emp->designation"."
";
}
?>
employee.xml
<?xml version="1.0" encoding="UTF-8"?> <empdetails> <employee> <empno>1</empno> <empname>sagar</empname> <salary>20000</salary> <designation>Clerk</designation> </employee> <employee> <empno>2</empno> <empname>Shubham</empname> <salary>30000</salary> <designation>Manager</designation> </employee> <employee> <empno>3</empno> <empname>Divya</empname> <salary>500000</salary> <designation>CEO</designation> </employee> </empdetails>
setb1.php
<?php
$xml=simplexml_load_file("setb1.xml");
foreach($xml->book as $book)
{
echo "Book No=$book->bookno"."
";
echo "Book Name=$book->bookname"."
";
echo "Author Name=$book->authorname"."
";
echo "Price=$book->price"."
";
echo "Year=$book->year"."
";
}
?>
setb1.xml
<?xml version="1.0" encoding="UTF-8"?> <BookInfo> <book> <bookno>1</bookno> <bookname>JAVA</bookname> <authorname>Balguru Swami</authorname> <price>250</price> <year>2006</year> </book> <book> <bookno>2</bookno> <bookname>PHP</bookname> <authorname>S.Kadam</authorname> <price>350</price> <year>2009</year> </book> <book> <bookno>3</bookno> <bookname>C</bookname> <authorname>Denis Ritchie</authorname> <price>500</price> <year>1971</year> </book> <book> <bookno>4</bookno> <bookname>C++</bookname> <authorname>Bjarne Straustrup</authorname> <price>400</price> <year>1994</year> </book> <book> <bookno>5</bookno> <bookname>DATABASE</bookname> <authorname>Rogers Presman</authorname> <price>700</price> <year>2001</year> </book> </BookInfo>
setb2.php <?php $dom=new DomDocument(); $dom->load("setb2.xml"); echo"
";
$mname=$dom->getElementsByTagName("moviename");
foreach($mname as $mn)
{
echo "$mn->textContent
";
}
$aname=$dom->getElementsByTagName("actorname");
foreach($aname as $an)
{
echo "$an->textContent
";
}
?>
setb2.xml <?xml version="1.0" encoding="UTF-8"?> <MovieInfo> <movie> <movieno>1</movieno> <moviename>Lookism</moviename> <actorname>Park Solomon</actorname> <year>2017</year> </movie> <movie> <movieno>2</movieno> <moviename>Atrangi Re</moviename> <actorname>Dhanush</actorname> <year>2022</year> </movie> <movie> <movieno>3</movieno> <moviename>Golmaal</moviename> <actorname>Ajay Devgn</actorname> <year>2018</year> </movie> <movie> <movieno>4</movieno> <moviename>Taare Zameen Par</moviename> <actorname>Aamir Khan</actorname> <year>2009</year> </movie> <movie> <movieno>5</movieno> <moviename>All Of Us Are Dead</moviename> <actorname>Park Solomon</actorname> <year>2022</year> </movie> </MovieInfo>
seta1.php
<?php
if(isset($_COOKIE['bca']))
{
$x=$_COOKIE['bca'];
$x=$x+1;
setcookie('bca',$x);
echo"
You accessed this page $x times";
}
else
{
$x=1;
setcookie('bca',$x);
echo"
You accessed this page $x times";
}
?>
seta2.php
<html>
<body>
<form method="POST" action="page2.php">
Font Style: <select name="style">
<option value="Arial">Arial
<option value="Italic">Italic
<option value="Times New Roman">Times New Roman
</select>
Font Size: <select name="size">
<option value="5">5
<option value="8">8
<option value="10">10
</select>
Font Color: <select name="fcolor">
<option value="blue">blue
<option value="red">red
<option value="black">green
</select>
Font Background: <select name="bcolor">
<option value="yellow">yellow
<option value="pink">pink
<option value="white">white
</select>
<input type="submit" name="s" value="submit"> </form> </body> </html>
cardataset
#Importing Libraries
import pandas as pd
#Reading data
df = pd.read_csv('C:/TYBSC/car_data.csv') # Importing the data set df.sample(5) print(df.sample(5)) print(df.shape)
#Print car companies with car numbers
print(df['Make'].value_counts()) new_df = df[df['Make']=='Volkswagen'] print(new_df.shape) # Viewing the new dataset shape
#Data Cleaning
print(new_df.isnull().sum()) new_df = new_df.dropna() print(new_df.isnull().sum()) new_df.shape new_df.isnull().sum() print(new_df.sample(2))
#Sample data for 2 variables..
new_df = new_df'Engine HP','MSRP' print(new_df.sample(5))
da
- Importing libraries
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression
- Read Data
df = pd.read_csv('C:/TYBSC/car_data.csv') # Importing the data set df.sample(5) #previewing dataset randomly print(df.sample(5)) new_df = df[df['Make']=='Volkswagen'] # in this new data set we only take 'Volkswagen' Cars
- print(new_df.isnull().sum()) # Is there any Null or Empty cell presents
new_df = new_df.dropna() # Deleting the rows which have Empty cells
- print(new_df.isnull().sum()) # Is there any Null or Empty cell presents
new_df.isnull().sum() #Is there any Null or Empty cell presents print(new_df.sample(2)) # Checking the random dataset sample new_df = new_df'Engine HP','MSRP' # We only take the 'Engine HP' and 'MSRP' columns print(new_df.sample(5))
- Split Train and Test dataset
X = np.array(new_df'Engine HP') # Storing into X the 'Engine HP' as np.array y = np.array(new_df'MSRP') # Storing into y the 'MSRP' as np.array plt.scatter(X,y,color="red") # Plot a graph X vs y plt.title('HP vs MSRP') plt.xlabel('HP') plt.ylabel('MSRP') plt.show() X_train,X_test,y_train,y_test = train_test_split(X,y,test_size = 0.25,random_state=15) regressor = LinearRegression() regressor.fit(X_train,y_train) plt.scatter(X_test,y_test,color="green") # Plot a graph with X_test vs y_test plt.plot(X_train,regressor.predict(X_train),color="red",linewidth=3) plt.title('Regression(Test Set)') plt.xlabel('HP') plt.ylabel('MSRP') plt.show() plt.scatter(X_train,y_train,color="blue") # Plot a graph with X_train vs y_train plt.plot(X_train,regressor.predict(X_train),color="red",linewidth=3) plt.title('Regression(training Set)') plt.xlabel('HP') plt.ylabel('MSRP') plt.show()
jqseta2.html
<!DOCTYPE html>
<html>
<head>
<title>
jQuery append() Method
</title>
<script src="../js/jquery-3.6.0.slim.min.js">
</script>
<script>
var i=4;
$(document).ready(function(){
$("#btn1").click(function(){
$("p").append("<b>Welcome</b>.");
});
$("#btn2").click(function(){
$("ol").append("<li>HVD "+i+++"</li>");
});
});
</script>
</head>
<body>
<h1 style="margin-left:150px;">Set A2</h1>
<p>Hello All</p>
<p>JQuery</p>
<ol>
<li>HVD 1</li>
<li>HVD 2</li>
<li>HVD 3</li>
</ol>
<button id="btn1">Append Welcome</button>
<button id="btn2">Append List</button>
</body>
</html>
jqseta3.html<!DOCTYPE html>
<html>
<body>
<p>Click button to display an alert box:</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction(){
alert("I am an alert box!");
}
</script>
</body>
</html>
jqseta3.html
<!DOCTYPE html>
<html>
<body>
<p>Click button to display an confirm box:</p>
<button onclick="confirm()">Try it</button>
<script>
var r=confirm("Press a button");
if(r==true){
x="You pressed OK!";
}
else{
x="You pressed cancel!";
}
</script>
</body>
</html>
jqseta4.html
<!DOCTYPE html>
<html>
<body>
<script>
var person=prompt("Please enter your name","");
if(person!==null){
document.getElementById("demo").innerHTML="Hello"+person+"!How are you today?";
}
</script>
</body>
</html>
jqseta5.html
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<button onclick="document.write(5+6)">Try it</button>
</body>
</html>
demo.php
<?php
setcookie("username","divya",time()+60*60*24*7);
?>
<html>
<body>
<form action="demo1.php">
<input type="submit" value="submit">
</form>
</body>
</html>
demo1.php
<?php
//updating the cookie
setcookie("username","iamdivya",time()+60*60*24*7);
?>
<html>
<body>
<?php
//check if cookie exists
if(isset($_COOKIE["username"]))
{
echo "cookie set wth value:".$_COOKIE["username"];
}
else
{
echo "cookie not set!";
}
?>
</body>
</html>
demo3.php
<?php
//updating the cookie
setcookie("username","iamdivya",time()-3600);
?>
<html>
<body>
<?php
echo "cookie username is deleted";
?>
</body>
</html>
demo4.php
<?php
setcookie("username","divya",time()+60*60*24*7);
?>
<html>
<body>
<form action="demo1.php">
<input type="submit" value="submit">
</form>
</body>
</html>