
-----------------------------------
websitedsc
Thu Mar 04, 2010 10:05 pm

Very Basic PHP help required
-----------------------------------
Allright so I have this PHP homework, basically I have to allow a user to enter a number into a text box between 10 and 60. PHP is then required to "simulate a dice rolling" 10 times using a for loop. The 10 "rolls" are then added together and compared to the users entry in the text box. It's a basic game, if the user guesses correctly they win etc. etc. Anyway, the code should explain things better, the only problem i am having is that the maximum of 10 rolls of the dice should be 60, but occasionally the result is more than this, more than often the number 66. Have no idea why its doing this. I've tried my best to explain, please ask questions if you don't understand what the hell im rambling on about. Cheers. Ignore the lack of standards in my markup.

HTML
 
question two html 
 
 
 
Enter a number between 10 and 60 in the box below. This is your guess. The object of the game is to try and get as close to the number the program calculates. . 
 
 
 
 
 
 
 
 
 
 
 


PHP
 
question two php 
 
 
 


-----------------------------------
Zren
Thu Mar 04, 2010 10:18 pm

RE:Very Basic PHP help required
-----------------------------------
for ($i = 0; $i 