Loop Number with PHP code

<?php

if(isset($_POST[‘Btnsubmit’]))
{
$getNum = $_POST[‘TxtSt’];
if( $getNum !=”” && is_numeric($getNum))
{
for($i=1;$i<=$getNum;$i++)
{

for($j=1;$j<=$i;$j++)
{
echo $j;
}
echo “<br/>”;
}
}

else{
echo “Please enter number”;
}
}

?>

<form action=”<?php $_SERVER[‘PHP_SELF’]?>” method=”post”>
<input type=”text” name=”TxtSt” value=”” />
<input type=”submit” name=”Btnsubmit” value=”Loop” />

</form>

By vichhaiy Posted in WEP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s