TIME NOW
World current time now,
CALENDAR
Calendar monthly, yearly
login GOLD PRICE, RATE
login HOROSCOPE
login DICTIONARIES, LISTS
login SCIENCE EDUCATION RELIGION
login FINANCE, BUSINESS
login WORLD COUNTRIES, WIKI

PHP scripts, code, examples, tutorial

Previous articlePage bottomNext article  ALL TOPICS

PHP. Loops. Form generator

 
<h3> FORM GENERATOR</h3>
<a href= "<?php
echo $_SERVER['PHP_SELF'];
?>">HOME</a><br>
<?php


$kiekis = $_GET["kiekis"];
$ch1    = $_GET["ch1"];
$ch2    = $_GET["ch2"];

if (!$kiekis)
  {
?>

<form action="<?php
    echo $_SERVER['PHP_SELF'];
?>" method="get">
Fields:<br>
<input type="text" name="kiekis" value=""><br><br>
Numbers of fields:
<Input type = "Checkbox" Name ="ch1" value ="a"> <br><br>
Radio buttons instead of check boxes:
<Input type = "Checkbox" Name ="ch2" value ="b"> <br> <br>
<input type="submit" Value ="Ok" ><br>
</form>

<form action="<?php
    echo $_SERVER['PHP_SELF'];
?>" method="get">

<?php
    
  }
elseif ($kiekis != "0")
  {
    
    
    
    for ($i = 1; $i <= $kiekis; $i++)
      {
        
        if ($ch1 == "a")
          {
            echo $i;
            
          }
?>

<input type="text" name="" value=""> <br>

<?php
        if ($ch2 == "b")
          {
?>

<Input type = 'Radio' Name ='' value= ''><br>

<?php
          }
        
      }
?>

<br><input type="submit" Value ="Patvirtinti" ><br>


<?php
  }
?>
</form>
 
Previous articlePage topNext article  ALL TOPICS



 Use username: Guest, Anonymous, Programmer






QUOTES:
People find life entirely too time-consuming.
Stanislaw Lec
Success is the child of drudgery and perseverance. It cannot be coaxed or bribed; pay the price and it is yours.
Orison Swett Marden
If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.
Albert Einstein