Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created March 12, 2020 08:55
Show Gist options
  • Save phpfiddle/461ad03d396fb07575f07f3d4f242746 to your computer and use it in GitHub Desktop.
Save phpfiddle/461ad03d396fb07575f07f3d4f242746 to your computer and use it in GitHub Desktop.
[ Posted by Zeusbeer ] H7 opdracht 8 fruitlijst sorteren (niet compleet)
<style>
label {
float:left;
display:block;
width:250px;
}
input{
display:block;
}
</style>
<html>
<form method="post" actions ="">
<label>fruit</label>
<input type = "text" name = "fruit">
<br>
<label>voeg fruit toe</label>
<input type = "submit" name = "verzenden">
</form>
</html>
<?php
$array = array();
$fruit = 0;
if(isset($_POST['verzenden']))
{
$fruit = $_POST['fruit'];
echo "HAY <br>";
}
array_push($array, $fruit);
for($i = 0; $i <= count($array); $i++)
{
echo $array[$i];
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment