
Tutaj kod.
<html> <head> <title>An XHTML 1.0 Strict standard template</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" </head> <body> <form action="form.php" method="POST"> <p> <div> <?php $_SESSION['0']=$al/$am; $_SESSION['1']=$bl/$bm; $_SESSION['2']=$cl/$cm; $_SESSION['3']=$dl/$dm; ?> </div> <div> Najwieksza <input type="text" name="1"/></br> 2 <input type="text" name="2"/></br> 3 <input type="text" name="3"/></br> Najmniejsza <input type="text" name="4"/></br> </div> <div style="width:1200px; margin: 0 auto; text-align:center; clear:both;"> <input type="submit" name="p2" value="wyślij"/> </div> </p> </body> </html>
Tutaj strona gdzie odbywa się szeregowanie:
<html> <head> <title>An XHTML 1.0 Strict standard template</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <style type="text/css"> </style> </head> <body style="width:1200px;"> <?php $tab[0]=$_SESSION['0']; $tab[1]=$_SESSION['1']; $tab[2]=$_SESSION['2']; $tab[3]=$_SESSION['3']; for( $i = 0; $i <= 3; $i++ ) { for( $j = 0; $j <= 3; $j++ ) { if( $tab[$j] < $tab[$j+1] ) { $a = $tab[$j]; $tab[$j] = $tab[$j+1]; $tab[$j+1] = $a; } } } if($tab[0]==$_POST['1']) { } else { } if($tab[1]==$_POST['2']) { } else { } if($tab[2]==$_POST['3']) { } else { } if($tab[3]==$_POST['4']) { } else { } ?> </body> </html>
Z góry dziękuje za pomoc. Od 1,5 tygodnia się z tym męczę.