Un italiano su quattro vuole usare internet per cercare o vendere casa Creare una bellissima composizione 3d con photoshop!




Feb 22

In questo tutorial imparerete come generare scelte casuali con PHP!

 

function Add()
{
var Space = document.getElementById(‘extra’);
 
Space.innerHTML +=
;
}

Cueburst - Random Choice Generator

 

Random Choice Generator
 
< ?php
 
$form =
Stuck with a decision?
Let me help!
+
 

 
 

 

 
‘;
 
if(!isset($_POST[’submit’]))
{
echo $form;
}
else
{
 
$choice = $_POST[‘choice’];
 
foreach($choice AS $number => $input)
{
if($input == null)
{
unset($choice[$number]);
}
}
 
if(count($choice) == 0)
{
echo Quack!No choices to choose from.’;
$answer = 0;
}
elseif(count($choice) == 1)
{
echo Quack!That was an easy choice.’;
$answer = 1;
}
else
{
echo Quack!;
$answer = 1;
}
 
$chosen = array_rand($choice);
 
if($answer == 1)
{
echo "Your choice is " . $choice[$chosen];
}
 
echo "
 
Another go?"
;
}
 
?>

 

fonte: www.sastgroup.com » Vai al post originale





Scrivi un commento