The Way to Programming
The Way to Programming
I’ve a bit of a problem with PHP and the interwebs is full of contradicting information.
Basically, I want to summon a function that uses the values using a html button. I’ve found that you can have your server listening to a form with some buttons in it, but it still won’t work…
Here’s my function:
function FillOutArray()
{
if(isset($_POST['submit']))
{
$array[counter] = $_POST['random'];
$counter+=1;
}
else // resetting array
{
$counter = 0;
$array = array();
}
}
and here’s my form:
you put that php code as a function but you never actually call that function. Unless there is more code you did`t post here. Try this:
if(isset($_POST['submit']))
{
$array[counter] = $_POST['random'];
$counter+=1;
}
else // resetting array
{
$counter = 0;
$array = array();
}
And make sure you clean anything that comes from user input. Although I have no clue what you will do with the data from the input, but it`s best to get the habit of closing security issues right away.
Also… Input type “textbox”? O_o
Use a text type or a textarea if you were aiming for a “textbox” and not a field. 
Sign in to your account
 English
English