rehab Posted November 8, 2014 Share Posted November 8, 2014 please can you help me in this question , imt confused about it Create a dice page, that allow the user to enter an integer (from1 to 6) and the program must generate a random number (from1 to 6). if the random number equals the users’ entered number an image with smiley facemust be displayed if not another image with sad face must be displayed. Also,you have to display the integer user entered and the program generated integer in the page. Quote Link to comment https://forums.phpfreaks.com/topic/292354-create-dica-page-using-php/ Share on other sites More sharing options...
requinix Posted November 8, 2014 Share Posted November 8, 2014 Confused about what, exactly? Seems fairly straightforward. Quote Link to comment https://forums.phpfreaks.com/topic/292354-create-dica-page-using-php/#findComment-1496076 Share on other sites More sharing options...
rehab Posted November 8, 2014 Author Share Posted November 8, 2014 Confused about what, exactly? Seems fairly straightforward. can you help me please in the sulotion Quote Link to comment https://forums.phpfreaks.com/topic/292354-create-dica-page-using-php/#findComment-1496108 Share on other sites More sharing options...
Ch0cu3r Posted November 8, 2014 Share Posted November 8, 2014 All you need is a form with a text input field so the user can enter a number You can generate a random number using the rand function. When the form has been submitted you can receive the number the user entered from the $_POST superglobal variable (provided your forms submit method is set to post - Otherwise use $_GET) To compare values you need to use an if statement with the == comparison operator To display an image use a the <img> tag Have ago yourself. If you get stuck then post what you have tried. Quote Link to comment https://forums.phpfreaks.com/topic/292354-create-dica-page-using-php/#findComment-1496110 Share on other sites More sharing options...
rehab Posted November 8, 2014 Author Share Posted November 8, 2014 alot of errors apear to me can you give me the correct answer please dear Quote Link to comment https://forums.phpfreaks.com/topic/292354-create-dica-page-using-php/#findComment-1496114 Share on other sites More sharing options...
Barand Posted November 8, 2014 Share Posted November 8, 2014 If you get stuck then post what you have tried. ... plus the precise error messages Quote Link to comment https://forums.phpfreaks.com/topic/292354-create-dica-page-using-php/#findComment-1496124 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.