+ All Categories
Home > Documents > Exercitii in Php Edit si dreamweaver

Exercitii in Php Edit si dreamweaver

Date post: 02-Apr-2015
Category:
Upload: valentin-mariusslave
View: 514 times
Download: 0 times
Share this document with a friend
41
EXERCITII IN PHP: Exemplul 1: <?php echo "ACEASTA ESTE PRIMUL EXERCITIU IN PHP."; ?> Exemplul 2: <?php echo "<img src='poze/perl.gif'alt='camila'><font size='6'color='red'>Salut</FONT> vizitatorule!"; echo "<br><a href='http://www.google.ro'> go </a><br>"; ?> Exemplul 3: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; echo $a." are ".$b." ani. "; echo "<br><font color='green'size='5'>".$a."</font><b> are </b><font color='blue'>".$b."</font><i><font size='1'> ani </font></i>." ?> Exemplul4: <?php $a=$_POST["t3"]; $b=$_POST["t4"]; echo $a." are ".$b." ani. "; if ($b<20) echo $a." este prea mic."; else if ($b==20) echo $a." esti potrivit <br> <a href='http://www.google.ro'>google</a>"; else echo $a." este prea mare <br> <a href='http://www.yahoo.com'>yahoo</a>"; ?> Exemplul 5: <?php $a=$_POST["t5"]; $b=$_POST["t6"]; if($a=="vizitator"&&$b=="123") echo "<a href='http://www.google.ro'>go</a>"; else echo "<html> <head> <title></title> </head> <body bgcolor='#ccc0000'><h1>EROARE</h1> <form name='f3' action='ex5.php' method='POST'> <h1>NUME:</h1> <input type='text' name='t5'><BR><BR> <h1>PAROLA:</h1> <input type='password' name='t6'> <br><br> <BR><input type='submit'VALUE='TRIMITE'> 1
Transcript
Page 1: Exercitii in Php Edit si dreamweaver

EXERCITII IN PHP: Exemplul 1: <?php echo "ACEASTA ESTE PRIMUL EXERCITIU IN PHP."; ?> Exemplul 2: <?php echo "<img src='poze/perl.gif'alt='camila'><font size='6'color='red'>Salut</FONT> vizitatorule!"; echo "<br><a href='http://www.google.ro'> go </a><br>"; ?> Exemplul 3: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; echo $a." are ".$b." ani. "; echo "<br><font color='green'size='5'>".$a."</font><b> are </b><font color='blue'>".$b."</font><i><font size='1'> ani </font></i>." ?> Exemplul4: <?php $a=$_POST["t3"]; $b=$_POST["t4"]; echo $a." are ".$b." ani. "; if ($b<20) echo $a." este prea mic."; else if ($b==20) echo $a." esti potrivit <br> <a href='http://www.google.ro'>google</a>"; else echo $a." este prea mare <br> <a href='http://www.yahoo.com'>yahoo</a>"; ?> Exemplul 5: <?php $a=$_POST["t5"]; $b=$_POST["t6"]; if($a=="vizitator"&&$b=="123") echo "<a href='http://www.google.ro'>go</a>"; else echo "<html> <head> <title></title> </head> <body bgcolor='#ccc0000'><h1>EROARE</h1> <form name='f3' action='ex5.php' method='POST'> <h1>NUME:</h1> <input type='text' name='t5'><BR><BR> <h1>PAROLA:</h1> <input type='password' name='t6'> <br><br> <BR><input type='submit'VALUE='TRIMITE'>

1  

Page 2: Exercitii in Php Edit si dreamweaver

<br><input type='reset' value='reset'> </form> </body> </html>"; ?> Exemplul 6: <?php $a=$_POST["t5"]; $b=$_POST["t6"]; if($a=="vizitator"&&$b=="123") echo "<a href='http://www.google.ro'>go</a>"; else if ($a!="vizitator"&&$b=="123") echo"<html> <head> <title></title> </head> <body bAckground='poze/BACKGRND.GIF'><h1>EROARE LA NUME</h1> <form name='f3' action='ex6.php' method='POST'> <h1>NUME:</h1> <input type='text' name='t5'><BR><BR> <h1>PAROLA:</h1> <input type='password' name='t6'> <br><br> <BR><input type='submit'VALUE='TRIMITE'> <br><input type='reset' value='reset'> </form> </body> </html>"; else if ($a=="vizitator"&&$b!="123") echo"<html> <head> <title></title> </head> <body background='poze/BACKGRND.GIF'><h1>EROARE LA PAROLA</h1> <form name='f3' action='ex6.php' method='POST'> <h1>NUME:</h1> <input type='text' name='t5'><BR><BR> <h1>PAROLA:</h1> <input type='password' name='t6'> <br><br> <BR><input type='submit'VALUE='TRIMITE'> <br><input type='reset' value='reset'> </form> </body> </html>"; else echo "<html> <head> <title></title> </head> <body background='poze/BACKGRND.GIF'><h1>AMBELE GRESITE</h1> <form name='f3' action='ex6.php' method='POST'> <h1>NUME:</h1> <input type='text' name='t5'><BR><BR> <h1>PAROLA:</h1> <input type='password' name='t6'> <br><br> <BR><input type='submit'VALUE='TRIMITE'> <br><input type='reset' value='reset'> </form> </body> </html>"; ?>

2  

Page 3: Exercitii in Php Edit si dreamweaver

Exemplul7: <?php $a=$_POST["t5"]; $b=$_POST["t6"]; if($a=="vizitator"&&$b=="123") echo "<a href='http://www.google.ro'>go</a>"; else if ($a!="vizitator"&&$b=="123") echo"<html> <head> <title></title> </head> <body background='poze/BACKGRND.GIF'><h1>EROARE LA NUME</h1> <form name='f3' action='ex7.php' method='POST'> <h1>NUME:</h1> <input type='text' name='t5'value='".$a."'><BR><BR> <h1>PAROLA:</h1> <input type='password' name='t6'value='".$b."'> <br><br> <BR><input type='submit'VALUE='TRIMITE'> <br><input type='reset' value='reset'> </form> </body> </html>"; else if ($a=="vizitator"&&$b!="123") echo"<html> <head> <title></title> </head> <body background='poze/BACKGRND.GIF'><h1>EROARE LA PAROLA</h1> <form name='f3' action='ex7.php' method='POST'> <h1>NUME:</h1> <input type='text' name='t5'value='".$a."'><BR><BR> <h1>PAROLA:</h1> <input type='password' name='t6'value='".$b."'> <br><br> <BR><input type='submit'VALUE='TRIMITE'> <br><input type='reset' value='reset'> </form> </body> </html>"; else echo "<html> <head> <title></title> </head> <body background='poze/BACKGRND.GIF'><h1>AMBELE GRESITE</h1> <form name='f3' action='ex7.php' method='POST'> <h1>NUME:</h1> <input type='text' name='t5'value='".$a."'><BR><BR> <h1>PAROLA:</h1> <input type='password' name='t6'value='".$b."'> <br><br> <BR><input type='submit'VALUE='TRIMITE'> <br><input type='reset' value='reset'> </form> </body> </html>"; ?>

3  

Page 4: Exercitii in Php Edit si dreamweaver

Exemplul8: <?php $a =$_POST["c1"]; $b =$_POST["c2"]; if ($a && $b) echo "ati ales".$a."si".$b; else if ($a &&!$b) echo "ati ales".$a; else if (!$a && $b) echo "ati ales".$b; else echo "nu ati ales"; ?> Exemplul9: <?php $a =$_POST["c1"]; $b =$_POST["c2"]; $c =$_POST["c3"]; $d =$_POST["c4"]; $mesaj=""; if($a)$mesaj=$mesaj.$a." "; if($b)$mesaj=$mesaj.$b." "; if($c)$mesaj=$mesaj.$c." "; if($d)$mesaj=$mesaj.$d." "; if($mesaj=="")$mesaj="nu ati ales nimic."; echo $mesaj; ?> Exemplul 10: <?php $x1a=$_POST["c1a"]; $x1b=$_POST["c1b"]; $x1c=$_POST["c1c"]; $x2a=$_POST["c1a"]; $x2b=$_POST["c2b"]; $x2c=$_POST["c2c"]; $x3a=$_POST["c3a"]; $x3b=$_POST["c3b"]; $x3c=$_POST["c3c"]; $x=$_POST["t1"]; $nota=1; if(!$x1a&&$x1b&&!$x1c) $nota=$nota+3; if(!$x2a&&$x2b&&$x2c) $nota=$nota+3; if(!$x3a&&!$x3b&&!$x3c) $nota=$nota+3; echo"D-l".$x."a obtinut nota .".$nota; ?> Exemplul 11: <?php $a=$_POST["r"]; if ($a)

4  

Page 5: Exercitii in Php Edit si dreamweaver

echo"Ati ales ". ?> Exemplul 12: <?php $a=$_POST["r"]; if($a) echo"<html> <head> <title></title> <style> input{font-size:24;color:blue;} </style> </head> <body bgcolor='".$a."'> <table bgcolor='ffcc000' border='4' bordercolor='blue' width='30%' align='center'> <tr> <td> <h2><form name='f6' action='ex12.php' method='POST'> buton 1<input type='radio' name='r' value='#ffcc000'><br> buton 2<input type='radio' name='r' value='green'><br> buton 3<input type='radio' name='r' value='red'><br><br> <input type='submit' name='s' value='submit'></h2><br> <input type='reset' name='r' value='reset'><BR> </td> </tr> </form> </table> </body> </html>"; ?> Exemplul13: <?php $a=$_POST["r"]; $b=$_POST["p"]; if($a&&$b) echo"<html> <head> <title></title> </head> <body bgcolor='".$a."' text='".$b."'> <table bgcolor='ffcc000' border='4' bordercolor='blue' width='30%' align='center'> <tr> <td> <h2><form name='f7' action='ex13.php' method='POST'> buton 1<input type='radio' name='r' value='#ffcc000'><br> buton 2<input type='radio' name='r' value='green'><br> buton 3<input type='radio' name='r' value='red'><br><br> buton 4<input type='radio' name='p' value='#ffccccc'><br> buton 5<input type='radio' name='p' value='pink'><br> buton 6<input type='radio' name='p' value='yellow'><br><br>

5  

Page 6: Exercitii in Php Edit si dreamweaver

<input type='submit' name='s' value='submit'></h2><br> <input type='reset' name='r' value='reset'><br> </td> </tr> </form> </body> </html>"; ?> Exemplul14: <?php $a=$_POST["s"]; if($a) echo"Ai ales ".$a; else echo"Nu ai ales nimic." ?> Exemplul15: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; $c=$_POST["s"]; $d=$_POST["r"]; $e=$_POST["c1"]; $f=$_POST["c2"]; if(!$c) $c="nu ai ales curs."; if(!$d) $d="nu ai ale orar."; $x=""; if($e) $x=$x.$e." "; if($f) $x=$x.$f." "; if($x=="") $x="nu ai ales nivelul"; echo"d-l/d-na".$a." ".$b."a ales cursul".$c."a ales orarul".$d."la nivelul".$x; ?> Exemplul16: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; $c=$_POST["t3"]; $d=$_POST["t4"]; $x=strlen($a); echo"sirul are".$x." caractere <br>"; if (strcmp($b,$c)>0) echo"sirul ".$b." este mai mare<br>"; else if(strcmp($b,$c)<0) echo" sirul ".$c." este mai mare <br>";

6  

Page 7: Exercitii in Php Edit si dreamweaver

else"sirurile sunt egale."; $p=strtolower($a); $r=strtoupper($b); $s=ucfirst($c); $t=ucwords($d); echo$p."<br>"; echo$r."<br>"; echo$s."<br>"; echo$t."<br>"; if(strstr($a,$b)) echo strstr($a,$b); else echo"nu exista"; ?> Exemplul17: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; if((strtolower($a)=="abc")&&($b=="xyz")) echo"ok"; else echo"eroare"; ?> Exemplul 18: <?php $a=$_POST["t1"]; $b=strstr($a,"@"); if($b)//[email protected] { $c=strstr($b,"."); if($c)//$c=.com { $d=strlen($c); if($d>=3) echo"ok"; else echo" prea putine caractere dupa punct."; } else echo"lipseste punctul"; } else echo"lipseste @"; ?> Exemplul 19: <?php $a=array("ian","febr","martie","aprilie","mai","iunie"); echo"A treia luna este"." ".$a[2].".<br>"; echo"Primele 6 luni sunt: "; for ($i=0;$i<6;$i++)

7  

Page 8: Exercitii in Php Edit si dreamweaver

echo$a[$i]." "; echo".<br><br><br>"; sort($a); echo"TABLOUL ORDONAT:<br> "; for ($i=0;$i<6;$i++) echo$a[$i]."<br> "; echo"<br><br><br>"; $b=array(array("ian","febr","martie"),array("aprilie","mai","iunie")); echo $b[0][1]; echo"<br><br><br>"; for($i=0;$i<2;$i++) { for ($j=0;$j<3;$j++) echo $b[$i][$j]." "; echo"<br>"; } echo"<br><br><br>"; $x=array("prima"=>"ianuarie","a 2-a"=>"februarie","a 3-a"=>"martie"); echo$x["a 3-a"]; echo"<br><br><br>"; print_r($x); echo"<br><br><br>"; $stiinte=array( "exacte"=>array( "unu"=>"mate", "doi"=>"fizica", "trei"=>"chimie"), "sociale"=>array( "unu"=>"filosofie", "doi"=>"sociologie", "trei"=>"psihologie") ); echo$stiinte["exacte"]["trei"]; echo"<br><br><br>"; print_r($stiinte["sociale"]); echo"<br><br><br>"; $y=implode($x,", "); echo$y; echo"<br><br><br>"; $sir="mere,pere,pepeni"; $z=explode(",",$sir); echo$z[2]; ?> Exemplul 20: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; mysql_connect("localhost","","")or die("eroare la conexiune"); mysql_select_db("agenda1")or die ("eroare la baza de date"); $x="select * from utilizatori where nume='".$a."'and parola='".$b."';"; $y=mysql_query($x); $k=0; while($z=mysql_fetch_array($y)) if($z["nume"]==$a &&$z["parola"]==$b) $k=1;

8  

Page 9: Exercitii in Php Edit si dreamweaver

if($k==0) echo"eroare la nume sau la parola"; else echo"ok"; ?> Exemplul 21(inregistrarea userului): <?php $a=$_POST["t1"]; $b=$_POST["t2"]; mysql_connect("localhost","","")or die("eroare la conexiune"); mysql_select_db("agenda1")or die ("eroare la baza de date"); $x="select * from utilizatori where nume='".$a."'and parola='".$b."';"; $y=mysql_query($x); $k=0; while($z=mysql_fetch_array($y)) if($z["nume"]==$a &&$z["parola"]==$b) $k=1; if($k==0) {echo" <html> <head> <title> </title> </head> <body bgcolor='#ffcccc'text='blue'> <form name='f2'action='fis1.php' method='POST'> <h1>Vreti sa va inregistrati?</h1> <h2>da:<input type='radio'value='da'name='r'></h2><br> <h2>nu:<input type='radio'value='nu'name='r'></h2><br> <input type='submit'value='submit'><br><br> <input type='reset'value='reset'><br><br> </form> </body> </html>";} else echo"ok"; ?> Exemplul 22-stergere inregistrare: <?php $a=$_POST["t1"]; echo$a." ".$b." "; mysql_connect("localhost","","")or die("eroare la conexiune"); mysql_select_db("agenda1")or die("eroare la conexiune"); $x="delete from prieteni where id='".$a."';"; $y=mysql_query($x); if($y)echo"ok"; else echo "eroare la conexiune"; ?>

9  

Page 10: Exercitii in Php Edit si dreamweaver

Exemplul23: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; echo$a." ".$b." "; mysql_connect("localhost","","")or die("eroare la conexiune"); mysql_select_db("agenda1")or die("eroare la conexiune"); $x="update prieteni set telefon='".$b."'where id='".$a."';"; $y=mysql_query($x); if($y)echo"ok"; else echo "eroare la conexiune"; ?> Exemplul 24- introducere php: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; $c=$_POST["t3"]; $d=$_POST["t4"]; $e=$_POST["t5"]; echo$a." ".$b." ".$c." ".$d; mysql_connect("localhost","","")or die("eroare la conexiune"); mysql_select_db("agenda1") or die("eroare la conexiune"); $x="insert into prieteni set nume='".$a."',prenume='".$b."',varsta='".$c."',telefon='".$d."',adresa='".$e."';"; $y=mysql_query($x); if($y)echo"ok"; else echo"eroare la introducere"; ?> Exempul25-fisier2: <?php $a=$_POST["t1"]; $b=$_POST["t2"]; mysql_connect("localhost","","")or die("eroare la conexiune"); mysql_select_db("agenda1")or die ("eroare la baza de date"); $x="insert into utilizatori set nume='".$a."',parola='".$b."';"; $y=mysql_query($x); if($y) echo"ati introdus cu succes!"; else echo"eroare la introducere" ?> Exemplul26-fisier 1: <?php $a=$_POST["r"]; if($a=="da") echo"<html> <head> <title> </title>

10  

Page 11: Exercitii in Php Edit si dreamweaver

</head> <body bgcolor='#fffcc00'> <form name='f'action='fis2.php'method='POST'> INTRODUCETI DATELE DE IDENTIFICARE :<BR> NUME <input type='text'name='t1'><br><br> PAROLA<input type='text'name='t2'><br><br> <input type='submit'value='submit'> <br><input type='reset'value='reset'><br> </form> </body> </html>"; else include("24 ian ex20 inregistrarea userului.html") ?>

11  

Page 12: Exercitii in Php Edit si dreamweaver

HTML

Exercitii in html: Ex3: <html> <head> <title></title> </head> <body bgcolor="#ccccfff"> <form name="f1" action="ex3.php" method="POST"> <h1>NUME:</h1> <input type="text" name="t1"><BR><BR> <h1>VARSTA:</h1> <input type="text" name="t2"> <br><br> <BR><input type="submit"VALUE="TRIMITE"> </form> </body> </html>

Ex4: <html> <head> <title></title>

12  

Page 13: Exercitii in Php Edit si dreamweaver

</head> <body bgcolor="#fffffff"> <form name="f2" action="ex4.php" method="POST"> <h1>NUME:</h1> <input type="text" name="t3"><BR><BR> <h1>VARSTA:</h1> <input type="text" name="t4"> <br><br> <BR><input type="submit"VALUE="TRIMITE"> </body> </html>

Ex5: <html> <head> <title></title> </head> <body bgcolor="#ccc0000"> <form name="f3" action="ex5.php" method="POST"> <h1>NUME:</h1> <input type="text" name="t5"><BR><BR> <h1>PAROLA:</h1> <input type="password" name="t6"> <br><br> <BR><input type="submit"VALUE="TRIMITE"> <br><input type="reset" value="reset"> </form> </body> </html>

13  

Page 14: Exercitii in Php Edit si dreamweaver

Ex6:

<html> <head> <title></title> </head> <body background="poze/BACKGRND.GIF"> <form name="f3" action="ex6.php" method="POST"> <h1>NUME:</h1> <input type="text" name="t5"><BR><BR> <h1>PAROLA:</h1> <input type="password" name="t6"> <br><br> <BR><input type="submit"VALUE="TRIMITE"> <br><input type="reset" value="reset"> </form> </body> </html>

14  

Page 15: Exercitii in Php Edit si dreamweaver

Ex7: <html> <head> <title></title> </head> <body background="poze/BACKGRND.GIF"> <form name="f3" action="ex7.php" method="POST"> <h1>NUME:</h1> <input type="text" name="t5"><BR><BR> <h1>PAROLA:</h1> <input type="password" name="t6"> <br><br> <BR><input type="submit"VALUE="TRIMITE"> <br><input type="reset" value="reset"> </form> </body> </html>

15  

Page 16: Exercitii in Php Edit si dreamweaver

Ex.8: <html> <head> <title></title> </head> <body bgcolor="ffcc000"> <form name="f4" action="11 ian ex8.php" method="POST"> <H2>FORMULAR:</H2> <H2>caseta 1:<input type="checkbox" name="c1" value="blue"></H2> <H2>caseta 2:<input type="checkbox" name="c2" value="green"></H2> <input type="reset" name="r" value="reset"><br> <input type="submit" name="s" value="submit"><br> </form> </body> </html>

16  

Page 17: Exercitii in Php Edit si dreamweaver

EX9: <html> <head> <title></title> </head> <body bgcolor="ffcc000"> <form name="f4" action="ex9.php" method="POST"> <H2>FORMULAR:</H2><BR><BR> <H2>caseta 1:<input type="checkbox" name="c1" value="blue"></H2><br><br><br><br> <H2>caseta 2:<input type="checkbox" name="c2" value="green"></H2><br><br><br><br> <H2>caseta 3:<input type="checkbox" name="c3" value="red"></H2><br><br><br><br> <H2>caseta 4:<input type="checkbox" name="c4" value="yellow"></H2><br><br><br><br> <input type="reset" name="r" value="reset"><br><br><br> <input type="submit" name="s" value="submit"> <br><Br><br> </form> </body> </html>

17  

Page 18: Exercitii in Php Edit si dreamweaver

EX10: <html> <head> <title> </title> <style> input {font-size:24;color:blue;} </style> </head> <body background="poze/lvback.gif"> <H2><font color="red"style="comic sans ms">FORMULAR</font></H2> <form name="f5" action="ex10.php" method="POST"> <h3>nume:<input type="text" name="t1"> <br> </h3> <h3>1.Cum e vremea afara?<br> a)ploioasa<input type="checkbox" value="z" name="c1a" ><br> b)geroasa<input type="checkbox" value="z" name="c1b" ><br> c)calduroasa<input type="checkbox" value="z" name="c1c"><br> 2.Cate zile pe saptamana avem cursuri?<br><br> a)luni<input type="checkbox" value="z" name="c2a" ><br> b)sambata<input type="checkbox" value="z" name="c2b" ><br>

18  

Page 19: Exercitii in Php Edit si dreamweaver

c)duminica<input type="checkbox" value="z" name="c2c"><br>

a script<input type="checkbox" value="z" me="c3c"></h3><br>

pe="reset" value="reset" name="buton2"><br>

</html>

3.Am dat vreun examen din modulele studiate?<br><br> a)da,la modulul html<input type="checkbox" value="z" name="c3a" ><br>

" ><br> b)da,la modulul de php<input type="checkbox" value="z" name="c3bc)da,la modulul de javna <input type="submit" value="submit" name="buton1"><BR><input ty</form> </body>

Ex11: <html> <head> <title></title> <style>

color:blue;} input{font-size:24; </style> </head> <body bgcolor="black"> <table bgcolor="ffcc000" border="4" bordercolor="blue" width="30%"

"center"> align=<tr>

19  

Page 20: Exercitii in Php Edit si dreamweaver

<td> <form name="f6" action="ex11.php" method="POST"> buton 1<input type="radio" name="r" value="blue"><br> buton 2<input type="radio" name="r" value="green"><br> buton 3<input type="radio" name="r" value="red"><br><br><input type="submit" name="s" value="submit"><br>

e="reset" name="r" value="reset"><BR> </form>

</html>

<input typ </td> </tr> </table> </body>

12: Ex

<html> <head> <title></title> <style>

color:blue;} input{font-size:24; </style> </head> <body bgcolor="blue"> <table bgcolor="ffcc000" border="4" bordercolor="blue" width="30%"

"center"> align=<tr>

20  

Page 21: Exercitii in Php Edit si dreamweaver

<td> <form name="f6" action="ex12.php" method="POST"> buton 1<input type="radio" name="r" value="#ffcc000"><br>

>

type="reset" name="r" value="reset"></form><BR>

</html>

buton 2<input type="radio" name="r" value="green"><br> buton 3<input type="radio" name="r" value="red"><br><br<input type="submit" name="s" value="submit"><br> <input </td> </tr> </table> </body>

Ex13: <html> <head> <title></title>

fcc000" border="4" bordercolor="blue" width="30%" "center">

</head> <body> <table bgcolor="falign=<tr> <td> <form name="f7" action="ex13.php" method="POST">

> buton 1<input type="radio" name="r" value="#ffcc000"><br

21  

Page 22: Exercitii in Php Edit si dreamweaver

buton 2<input type="radio" name="r" value="green"><br> buton 3<input type="radio" name="r" value="red"><br><br> buton 4<input type="radio" name="p" value="#ffc0000"><br>

<br>

type="reset" name="r" value="reset"></form><BR>

html>

buton 5<input type="radio" name="p" value="pink"><br> buton 6<input type="radio" name="p" value="yellow"><br><input type="submit" name="s" value="submit"><br> <input </td> </tr> </body> </

14: Ex

<html> <head> <title></title> <style> form{font-size:24; color:blue;} select{font-size:24; color:red;} input{font-size:24; color:green;}

</style>

cc000">

</head> <body bgcolor="#ff<H1>CULORI:</h1>

22  

Page 23: Exercitii in Php Edit si dreamweaver

<form name="f8" action="ex14.php" method="POST">

>

">pink</option>

pe="reset" value="reset"><br><BR>

html>

<h2>Lista de selectie:</h2> <select name="s" size="3"> <option value="red">rosu</option> <option value="yellow">yellow</option<option value="blue">blue</option> <option value="green">green</option><option value="gray">gray</option> <option value="pink</select><br><br> <input type="submit" value="submit"><br><br><input ty</form> </body> </

Ex15:

<title></title>

<html> <head> </head> <body bgcolor="black">

ONT></H2> <H2><FONT COLOR="#FFCC000">FORMULAR:</F

23  

Page 24: Exercitii in Php Edit si dreamweaver

<table border="4" bgcolor="#ffcc000"> <form name="f9" action="ex15.php" method="POST">

: <input type="text" name="t2"><br><br>

ecretariat informatizat</option> ue="engleza">engleza</option>

t>

r><br> put type="radio" value="14-20" name="r">

r> br>

1"><br>

r>

BR><br>

pe="submit" value="submit"> <br>

html>

<tr> <td> nume:<input type="text" name="t1"><br><br> prenume</td> <td>cursul: <select size="3" name="s"> <option value="web design">web design</option> <option value="depanare calculatoare">depanare calculatoare</option> <option value="grafica puplicitara">grafica publicitara</option> <option value="contabilitate primara">contabilitate primara</option> <option value="secretariat informatizat">s<option val</selec</td> <td> <br>orar:<br><Br> 08-14<input type="radio" value="08-14" name="r"><b14-20<in</td> <td> <br> incepatori<input type="checkbox" name="c1" value="incepatori"><bavansati<input type="checkbox" name="c2" value="avansati"><</td> <td><input type="submit" value="submit" name="buton

="reset" value="reset" name="buton 2"> <input type</td><b</tr> </form> </table> </body> html> </

Ex16: <html> <head>

<title></title> </head> <body bgcolor="#fffc000">

POST"> <form name="f10" action="ex17.php" method="USER<input type="text" name="t1"><br><br> PAROLA<input type="password" name="t2"><<input type="reset" value="reset"><Br> <input ty</form> </body> </

24  

Page 25: Exercitii in Php Edit si dreamweaver

Ex.16 bis:

<title></title>

ccc000" text="brown">

br>

<br><br>

pe="submit" value="submit"> <br>

html>

<html> <head> </head> <body bgcolor="#ff<B>FORMULAR:</B> <form name="f10" action="ex16.php" method="POST"> <b>caseta 1</B></B><input type="text" name="t1"><br><<b>caseta2</b><input type="text" name="t2"><BR><br> <b>caseta3</b><input type="text" name="t3"><Br><br> <b>caseta4</b><input type="text" name="t4"><input type="reset" value="anuleaza"><Br> <input ty</form> </body> </

25  

Page 26: Exercitii in Php Edit si dreamweaver

Ex.17: <html> <head> <title></title> <style> #x1 { color:red; } </style> </head> <body bgcolor="#fffcccc" text="brown"> <form name="f10" action="ex18.php" method="POST"> <h1>e-mail:</h1><input type="text" name="t1" id="x1"><br><br>

pe="submit" value="submit"> <br>

html>

<input type="reset" value="reset"><Br> <input ty</form> </body> </

26  

Page 27: Exercitii in Php Edit si dreamweaver

Ex.18: <html> <head> <title></title>

method="post">

pe="submit" value="introducere"><br>

html>

</head> <body BGCOLOR="#FFCC000" text="blue"> FORMULAR <form name="f" action="introducere php.php" nume <input type="text" name="t1"><br><br> prenume<input type="text" name="t2"><br><br> varsta<input type="text" name="t3"><br><br> telefon<input type="text" name="t4"><br><br>adresa<textarea name="t5"></textarea><br> <input type="reset" value="reset"><br> <input ty</form> </body> </

Ex.19 modificare html: <html> <head>

<title></title>

27  

Page 28: Exercitii in Php Edit si dreamweaver

</head> <body BGCOLOR="#fffffcc" text="green"><h3><u>FORMULAR:</u> </h3>

od="post">

pe="submit" value="introducere"><br>

html>

<form name="f" action="modificare.php" methid: <input type="text" name="t1"><br><br> telefon:<input type="text" name="t2"><br><br> <input type="reset" value="reset"><br> <input ty</form> </body> </

Ex.20 stergere inregistrare in html:

<title></title>

e.php" method="post">

pe="submit" value="introducere"><br>

<html> <head> </head> <body BGCOLOR="#fffffff" text="brown"><h1><u>FORMULAR:</u> <form name="f" action="stergere inregistrar

nput type="text" name="t1"><br><br> id: <i<br> <input type="reset" value="reset"><br> <input ty</form> </body> html> </

28  

Page 29: Exercitii in Php Edit si dreamweaver

Ex.21 inregistrare user:

<title></title>

action="24 ian ex20 inregistrarea userului.php"

<html> <head> </head> <body> <form name="f1" method="POST"> nume:<input type="text" name="t1"><br> parola:<input type="text" name="t2"><br> <input type="submit" value="submit"><br>

pe="reset" value="reset"><br> <input ty</form> </body> html> </

29  

Page 30: Exercitii in Php Edit si dreamweaver

Ex22: <html> <head> <title></title> </head> <body> <form name="f1" action="24 ian ex20.php" method="POST"> nume:<input type="text" name="t1"><br> parola:<input type="text" name="t2"><br> <input type="submit" value="submit"><br> <input type="reset" value="reset"><br> </form> </body> </html>

30  

Page 31: Exercitii in Php Edit si dreamweaver

Ex23 afisare elemente selectate: <html> <head> <title></title> <script> function suma(t1,t2) { n=t1.value; n=parseInt(n) s=0; for(i=1;i<=n;i++) s=s+i; t2.value=s; } </script> </head> <body> <form> n=<input type="text" name="t1"><br><br> suma=<input type="text" name="t2"><br><br> <input type="button" value="calcul" onclick ="suma(t1,t2)"> </form> </body> </html>

31  

Page 32: Exercitii in Php Edit si dreamweaver

Ex24 ex java script putere: <html> <head> <title></title> <script> function produs(t1,t2) { a=t1.value, a=parseInt(a) b=t2.value, b=parseInt(b) x=1; for(i=1;i<=b;i++) x=x*a; alert(x); } </script> </head> <body> <form> a:<input type="text" name="t1"> <br>b: <input type="text" name="t2"> <br><input type="button" value="calcul" onClick="produs(t1,t2)"> </form> </body> </html>

32  

Page 33: Exercitii in Php Edit si dreamweaver

Ex.25 lista alfabetica: <html> <head> <title></title> </head> <body> <ol type="a" start="3"> <li>mere</li> <li>pere</li> <li>prune</li> </ol> <br> CUMPARATURI:</br> <table border="1" width="70%" cellspacing="20" align="center"> <tr> <td rowspan="3">nume si pret</td> <td>mere</td> <td>20 lei</td> </tr> <tr> <td>pere</td> <td>30 lei</td> </tr> <tr> <td>struguri</td> <td>40 lei</td>

33  

Page 34: Exercitii in Php Edit si dreamweaver

</tr> </table> </body> </html>

Ex.26 lista ordonata: <html> <head> <title></title> </head> <body> <table border="1"> <tr> <td> <ol type="1"> <li><b>FRUCTE</b></li> <ul type="square"> <li>mere</li> <li>pere</li> </ul> <li>LEGUME</li> <ul type="circle"> <li>rosii</li> <li>cartofi</li>

34  

Page 35: Exercitii in Php Edit si dreamweaver

</ul> </ol> </td> <td><img src="poze/lvback.gif"></td> </tr> </table> </body> </html>

Ex.27: <html> <head> <title></title> </head> <body> <table border="2"width="90%"> <tr> <td colspan="2"><br></td> <td><br></td> <td><br></td> </tr> <tr> <td><br></td> <td rowspan="3"><br></td> <td><br></td>

35  

Page 36: Exercitii in Php Edit si dreamweaver

<td><br></td> </tr> <tr> <td><br></td> <td colspan="2"><br></td> </tr> <tr> <td><br></td> <td colspan="2"><br></td> </tr> </table> </body> </html>

Ex28 tabel nume si prenume: <html> <head> <title></title> </head> <body bgcolor="#ffcc0000"> <table bgcolor="#ffff00" border="4" bordercolor="red"> <tr> <td colspan="2"><h1>nume si prenume</h1></td> <td><h1>varsta</h1></td>

36  

Page 37: Exercitii in Php Edit si dreamweaver

</tr> <tr> <td><br></td> <td><br></td> <td rowspan="2"><h1>20</h1></td> </tr> <tr> <td><br></td> <td><br></td> </tr> </table> </body> </html>

Ex.29 tabel: <html> <head> <title></title> </head> <body bgcolor="#ffcc000"> <h1>TITLU</h1> <table border="4" bordercolor="red"> <tr> <td colspan="2" bgcolor="blue"><br></td> <td><img src="poze/perl.gif"></td>

37  

Page 38: Exercitii in Php Edit si dreamweaver

</tr> <tr> <td rowspan="2"><font size="5">text</font></td> <td rowspan="2"><img src="poze/d1.gif"></td> <td bgcolor="white"><br></td> </tr> <tr> <td bgcolor="blue"><br></td> </tr> </table> </body> </html>

Ex.31 afisarea datelor: <html> <head> <title></title> </head> <body bgcolor="#cccccc"> <form name="f" action="afisarea datelor.php" method="POST"> <input type="submit" value="afisarea datelor"></form>

38  

Page 39: Exercitii in Php Edit si dreamweaver

</body> </html>

Ex31 afisarea unui table in php: <html> <head> <title></title> </head> <body bgcolor="#ffcccc"> <form name="f" action="afisarea unui tabel in php.php" method="POST"> <input type="submit" value="afisarea datelor"></form> </body> </body> </html>

39  

Page 40: Exercitii in Php Edit si dreamweaver

Ex32: Ex 33 dictionar: <html> <head> <title></title> </head> <body background="poze/BACKGRND.GIF"> <form name="f4" action="dictionar.php" method="POST"> <H1>DICTIONAR:</H1> <h2>Introduceti cuvantul:</h2><input type="text"name="t1"><br><br> <input type="submit" value="submit"><br> <br><input type="reset" value="reset"></form> </body> </html>

40  

Page 41: Exercitii in Php Edit si dreamweaver

41  


Recommended