05- Kapja e argumentave te perdoruesit

Ne kete leksion

Faqa shahu.php e parametrizuar

shahu3.php

<?php

$n=8;

$m=8;

if(isset($_REQUEST['rreshta']))

{

$n=$_REQUEST['rreshta'];

$n=$n+0;

if ($n==0) exit('kujdes');

}

if(isset($_REQUEST['kollona']))

{

$m=$_REQUEST['kollona'];

}

?>

<html>

<head>

<title>Tabele Shahu</title>

<script language="JavaScript">

function tell(x,y)

{

alert('Ju keni klikuar ne kutine '+x+','+y);

}

</script>

</head>

<body>

<table border="1" >

<?php

for($i=1;$i<=$n;$i++)

{

?>

<tr>

<?php

for($j=1;$j<=$m;$j++)

{

?>

<td height="50" width="50" onClick="tell(<?php echo $i; ?>,<?php echo $j; ?>);"

<?php

if((($i+$j)%2)==0)

{

echo 'bgColor="brown" ';

}

else

{

echo 'bgColor="white" ';

}

?>

>

</td>

<?php

}

?>

</tr>

<?php

}

?>

</table>

</body>

</html>

Faqa parametrizuese designer.php

designer.php

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<form name="form1" method="get" action="shahu2.php">

Rreshta

<input name="rreshta" type="text" id="rreshta">

<br>

Kollona

<input name="kollona" type="text" id="kollona">

<br>

<input type="submit" name="Submit" value="KRIJO">

</form>

<p>&nbsp;</p>

<p>&nbsp;</p>

<form name="form2" method="get" action="shahu2.php">

<p>Rreshta

<select name="rreshta" id="rreshta">

<option value="8" selected>Tete</option>

<option value="10">Dhjete</option>

<option value="12">Dymbedhjete</option>

<option value="40">Dyzet</option>

</select>

<br>

Kollona

<select name="kollona" id="kollona">

<option value="8" selected>Tete</option>

<option value="10">Dhjete</option>

<option value="12">Dymbedhjete</option>

<option value="40">Dyzet</option>

</select>

</p>

<p>

<input type="submit" name="Submit2" value="KRIJO">

</p>

<p>&nbsp;</p>

</form>

<form name="form3" method="post" action="shahu2.php">

<p>

<input name="rreshta" type="hidden" id="rreshta" value="10">

<br>

Kollonat

<input name="kollona" type="password" id="kollona">

</p>

<p>

<input type="submit" name="Submit3" value="KRIJO">

<br>

</p>

</form>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

</body>

</html>