0% found this document useful (0 votes)
32 views

HTML, Java Script, PHP

This document contains information about HTML tags and elements. It discusses anchors and links, tables, forms, headings, text styling, and form validation. Specifically: 1) It defines anchors and links, explaining that anchors create connections within or between pages and links are defined in the head and anchors in the body. 2) It provides an example of a table with multiple rows and cells. 3) It shows a form with input fields for values, radio buttons for operations, and a submit button to calculate. 4) It includes PHP code to process the form submission and perform calculations based on the selected operation.

Uploaded by

Popikal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

HTML, Java Script, PHP

This document contains information about HTML tags and elements. It discusses anchors and links, tables, forms, headings, text styling, and form validation. Specifically: 1) It defines anchors and links, explaining that anchors create connections within or between pages and links are defined in the head and anchors in the body. 2) It provides an example of a table with multiple rows and cells. 3) It shows a form with input fields for values, radio buttons for operations, and a submit button to calculate. 4) It includes PHP code to process the form submission and perform calculations based on the selected operation.

Uploaded by

Popikal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

NR.

1
I
ancora=cand ma duc intr-un anumit punct din document
legatura=cand ma duc undeva in exterior
legatura-link la o pagina externa
ancora face legatura dintre anumite puncte din aceeasi pagina sau
dintre puncte din pagini diferite
link -este definit in head
ancora in body
II
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<-- text -->
</td>
<td colspan="2">
<-- test -->
</td>
</tr>
<tr>
<td>
Admisi
<td> <!-- text --></td>
<td> <!-- text --></td>
<td> <!-- text --></td>
</tr>
<tr>
<td>
<td>
<td>
<td>
</tr>
<tr>
<td>
<td>
<td>
<td>

</td>

Respinsi
</td>
<!-- text --></td>
<!-- text --></td>
<!-- text --></td>

Total
</td>
<-- text --></td>
<-- text --></td>
<-- text --></td>

</tr>
</table>
III
<form method="POST" action="calcul.php">
<table border="0" style="border:1px solid #000;">
<tr>
<td colspan="2">
<label for="val1">val1: </label><input type="text"
name="val1" /> </td>
</tr>
<tr>
<td><label for="val2">val2: </label><input type="text"
name="val2"> </td>
<td><input type="submit" value="Calculeaza"></td>
</tr>
<tr>
<td colspan="2">
<table border="0" width="100%">
<tr>
<td><input type="radio" checked name="operatie"
value="adunare" > + </td>
<td align="right"><input type="radio" name="operatie"
value="scadere" /> - </td>
<td><input type="radio" name="operatie"
value="inmultire" />*</td>
<td align="right"><input type="radio" name="operatie"
value="impartire"> / </td>
</tr>
</table>

</td>
</tr>
</table>
</form>
IV
<?php
if(!emtpy($_POST))
{
if(is_numeric($_POST['val1']) &&
is_numeric($_POST['val2']))
{
switch ($_POST["operatie"])
{
case "adunare":
{
echo
$_POST['val1']."
$_POST['val2']." = ".($_POST['val1'] +
$_POST['val2']); break;
}
case "scadere":
{
echo
$_POST['val1']."
$_POST['val2']." = ".($_POST['val1'] $_POST['val2']); break;
}
case "inmultire":
{
echo
$_POST['val1']."
$_POST['val2']." = ".($_POST['val1'] *
$_POST['val2']); break;
}
case "impartire":
{
echo
$_POST['val1']."
$_POST['val2']." = ".($_POST['val1'] /
$_POST['val2']); break;
}
}
}
}
?>

+ ".

- ".

* ".

/ ".

NR.2
I
<h1>-<h6> - definete titlul unei seciuni din document
<h1>- corespunde seciunii cu importana cea mai mare i
titlul definit va avea mrimea cea mai mare.
Se foloseste pentru titluri
II
<i>acest text este italic darorita proprietatii etichetei i. </i>
<style type="text/css">
i{
color: yellow;
font-size: 16;
}
</style>
<p class="special">acesta este un element "special"</p>
<p class="special">acesta este un element "special"</p>
<p class="special">acesta este un element "special"</p>
<p class="special">acesta este un element "special"</p>
<style type="text/css">
.special{
color: green;
font-size:24;
}
</style>
<p id="unic">acesta este un element unic.</p>
<style type="text/css">
#unic{
color:red;
}
</style>

III
<html><body>
<script type="text/javascript">
function valideaza { }
{
var salariu =
parseInt(document.getElementById('salariu').value);
if(salariu > 0 ) {
document.getElementById('buton').type="submit";
document.getElementById('buton').value="Trimite";
document.getElementById('eroare').innerHTML="Nici o
eroare";
}
else {
document.getElementById('eroare').innerHTML="Reintroduceti salariul" ;
document.getElementById('salariu').focus();
}
}
</script>
<p id="eroare"></p>
<form method="GET" action="afisare.php">
<label for="nume">nume: <input type="text"
name="nume" id="nume" ></label> <br>
<label for="salariu">salariu: <input type="text"
name="salariu" id="salariu"></label> <br>
<input type="button"id="buton"value="Valideaza" onClick=
"valideaza()" >
</form>
</body>
</html>

You might also like