I have a function to generate 13 random integers between a certain range with no duplicates.
I'm not sure on the next part is correct, but I have a button that on $_POST will send to my php script which generates 1 image from the database at a time. I need it to send the random numbers from my generate_numbers function, all 13 of them., because in the end I want to display 13 different images with 1 click of the button. How do I approach this problem? Do i need a queue?
**Button to submit to PHP form named display.php**
<input type="submit" name"display" value=generate_numbers()>
var generate_numbers = function()
{
var i, j;
var array=[];
for(i=0; i < 13; i++)
{
array[i] = Math.floor(Math.random()*14)+16);
for(j=0;j<i;j++)
{
while(array[i]==array[j])
{
array[i]= Math.floor(Math.random()*14)+16);
}
}
return array[i];
}