2016-03-09, 01:09 PM
In my code I have a var that generates a random number between 1-12
$randomnumber = rand(1,12);
I then display {$randomnumber} in a template that shows this random number which may show 4 for example.
I then do
if( $mybb->input['bet'] == 'high' )
{
error($randomnumber);
}
Which shows a completely different number to the one showing in the template. I believe this is because the function is run by the template and then rerun in the script. As when I run the action bet=high it displays a different number to the one in the template is there any way to avoid this?
$randomnumber = rand(1,12);
I then display {$randomnumber} in a template that shows this random number which may show 4 for example.
I then do
if( $mybb->input['bet'] == 'high' )
{
error($randomnumber);
}
Which shows a completely different number to the one showing in the template. I believe this is because the function is run by the template and then rerun in the script. As when I run the action bet=high it displays a different number to the one in the template is there any way to avoid this?