Html ve Php ile Form İşlemleri

UYGULAMA 1

FORM.PHP


<body>

<form id=”form1″ name=”form1″ method=”post” action=”goster.php”>

<p>Ad :

<label for=”t1″></label>

<input type=”text” name=”t1″ id=”t1″ />

</p>

<p>Soyad :

<label for=”t2″></label>

<input type=”text” name=”t2″ id=”t2″ />

</p>

<p>

<input type=”submit” name=”button” id=”button” value=”Kaydet” />

</p>

</form>

GOSTER.PHP


<body>

<?php

$ad=$_POST[“t1”];

$soyad=$_POST[“t2″];

echo $ad.” “.$soyad;

?>

</body>

 

UYGULAMA 2

 SINAV_NOTU.PHP

<body>

<form id=”form1″ name=”form1″ method=”post” action=””>

<p>Yazılı 1 :

<label for=”t1″></label>

<input type=”text” name=”t1″ id=”t1″ />

</p>

<p>Yazılı 2 :

<label for=”t2″></label>

<input type=”text” name=”t2″ id=”t2″ />

</p>

<p>Performans 1 :

<label for=”t3″></label>

<input type=”text” name=”t3″ id=”t3″ />

</p>

<p>Performans 2 :

<label for=”t3″></label>

<input type=”text” name=”t4″ id=”textfield” />

</p>

<p>

<input type=”submit” name=”button” id=”button” value=”Sonuç” />

</p>

</form>

</body>


SINAV_NOTU_GOSTER.PHP

<body>

<?php

$y1=$_POST[“t1”];

$y2=$_POST[“t2”];

$p1=$_POST[“t3”];

$p2=$_POST[“t4”];

$ortalama=($p1+$p2+$y1+$y2)/4;

echo “Not ortalamanız= “.$ortalama;

if ($ortalama<50)

{

echo “KALDINIZ”;

}

else

{

echo “GEÇTİNİZ”;

}

?>

</body>