Darmowe Forum
Maj 03, 2024, 11:28:45 *
Witamy, Gość. Zaloguj się lub zarejestruj.
Czy dotarł do Ciebie email aktywacyjny?

Zaloguj się podając nazwę użytkownika, hasło i długość sesji
Aktualności: Forum zostało uruchomione!
 
   Strona główna   Pomoc Zaloguj się Rejestracja  
Strony: [1]
  Drukuj  
Autor Wątek: Petle w php  (Przeczytany 6685 razy)
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« : Marzec 05, 2014, 13:07:00 »

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  <meta name="Description" content=" [wstaw tu opis strony] ">
  <meta name="Keywords" content=" [wstaw tu slowa kluczowe] ">
  <meta name="Author" content=" [dane autora] ">
  <meta name="Generator" content="kED2">

  <title> [tytuł strony] </title>

  <link rel="stylesheet" href=" [nazwa_arkusza_stylow.css] " type="text/css">
</head>
<body> wita
<form action="" method="POST">
     Imię: <input type="text" name="imie" /><br />
     Nazwisko: <input type="text" name="nazwisko" /><br />
     Adres: <input type="text" name="adres" /><br />
     <br />
     <input type="submit" name="send" value="OK" /><br />
</form> <br>


<?php

$suma=1;
for($a=1;$a<11;$a++)
{$suma=$suma*$a;
}
echo("<br>");
echo("Iloczyn liczb od 1 do 10 = ");
echo($suma);
?>


</body>
</html>
« Ostatnia zmiana: Marzec 05, 2014, 13:09:00 wysłane przez admin » Zapisane
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« Odpowiedz #1 : Marzec 07, 2014, 12:22:58 »

Zadanie 2.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  <meta name="Description" content=" [wstaw tu opis strony] ">
  <meta name="Keywords" content=" [wstaw tu slowa kluczowe] ">
  <meta name="Author" content=" [dane autora] ">
  <meta name="Generator" content="kED2">

  <title> [tytuł strony] </title>

  <link rel="stylesheet" href=" [nazwa_arkusza_stylow.css] " type="text/css">
</head>
<body>
<?php
$a=10;
$b=15;
$c=20;
echo ($a);echo"<br>";
echo ($b);echo"<br>";
echo ($c);echo"<br>";
echo "a= ";echo($a);echo"<br>";
echo "a+c= ";echo($b+$c);echo"<br>";
echo "(a+b)/c= ";echo(($a+$b)/$c);echo"<br>";

for($i=$a;$i<$c+1;$i=$i+2)
{echo " ";echo($i);};

?>

<!-- tutaj wstaw tresc strony -->

</body>
</html>
Zapisane
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« Odpowiedz #2 : Marzec 07, 2014, 13:16:31 »

Zadanie 3.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  <meta name="Description" content=" [wstaw tu opis strony] ">
  <meta name="Keywords" content=" [wstaw tu slowa kluczowe] ">
  <meta name="Author" content=" [dane autora] ">
  <meta name="Generator" content="kED2">

  <title> [tytuł strony] </title>

  <link rel="stylesheet" href=" [nazwa_arkusza_stylow.css] " type="text/css">
</head>
<body>
<form action="adam.php" method="post">
    <fieldset>
    <legend><font color="red">Sprawy do rozwiązania</font></legend>
               
        <label for="imie">Imię:</label>
        <input type="text" id="imie" name="imie"/></div>
                   
        <label for="mail">Twój e-mail:</label>
        <input type="text" id="mail" name="mail"/><br>
                   
        <label for="temat">Temat: </label>
        <input type="text" id="temat" name="temat"/><br>
                   
        <label for="wiadomosc">Wiadomość:</label><br>
        <textarea id="wiadomosc" name="wiadomosc" cols="40" rows="10"></textarea>
                   
        <input type="submit" value="Wyślij" id="send" name="send" />
    </fieldset>
</form>
<!-- tutaj wstaw tresc strony -->

</body>
</html>
Zapisane
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« Odpowiedz #3 : Marzec 12, 2014, 11:20:22 »

Zadanie 4.

<html>
<head>
<meta http-equiv="Content-Language" content="pl">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<title>Formularz</title>
</head>
<body>
<form method="POST">
<p>Podaj swoje imie <input type="text" name="imie" size="20"></p>
<p>Podaj swoje nazwisko <input type="text" name="nazwisko" size="20">
<br>
<p>Podaj hasło <input type=password name="haslo"><br>
<input type="submit" value="Wczytaj" name="B2"></p>
</form>

<?php
$a=$_POST["imie"];
$b=$_POST["nazwisko"];
$c=$_POST["haslo"];
$h="adam";
if (($a=="")||($b=="")){
echo ("Brak danych");
}
else
{
echo("Cześć <b>".$_POST["imie"]." ".$_POST["nazwisko"]."</b>");
};echo("<br>");

if($c!=$h||$c=="")
{for($aa=1;$aa<11;$aa++){echo($aa);}}

else {
for($aa=10;$aa>=1;$aa--){echo($aa);}

}
?>

</body>
</html>
Zapisane
admin
Administrator
Ekspert
*****
Wiadomości: 821


Email
« Odpowiedz #4 : Marzec 12, 2014, 12:24:03 »

Zadanie 5. Rafał1

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  <meta name="Description" content=" [wstaw tu opis strony] ">
  <meta name="Keywords" content=" [wstaw tu slowa kluczowe] ">
  <meta name="Author" content=" [dane autora] ">
  <meta name="Generator" content="kED2">

  <title> [tytuł strony] </title>

  <link rel="stylesheet" href=" [nazwa_arkusza_stylow.css] " type="text/css">
</head>
<body>

<?php
$a=1; $b=20;
for($b=20;$b>=$a;$b=$b-2)
{echo($b." ");}

?>
</body>
</html>
Zapisane
Strony: [1]
  Drukuj  
 
Skocz do:  

Powered by SMF 1.1.11 | SMF © 2006-2008, Simple Machines LLC | Sitemap

Polityka cookies
Darmowe Fora | Darmowe Forum

dnie-noce polskierpg batawia artofwar kehatamatuhiujalulla