Jump to content

lilush

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lilush's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Is there a way to use this $_SESSION["presentedTryNum"] += 1; and each time it counts a diffrent image would appear? and again- thank you so much for your help
  2. WOW Thank you!!! How do I get the images of the hanging man to appear whenever someone makes a mistake? I have 8 images the first one is 0 mistake so it is displayd on the start and with each mistake a body part appears (image mistake 2, mistake 3 etc)
  3. ok- I turned it could you tell me how I use array_rand()? I'm sorry I'm really new at this
  4. yeah I don't know how to get the program to randomly pick one of the words in the word bank
  5. ok- in english: <?php session_start(); if ( !isset($_SESSION['word']) ) { $wordList="table curtain printer guitar piano dragon pack bottle shirt picture"; } ?> <html> <body> <?php if(isset($_POST["exit"])) { ?> thank you and goodbey! <br> <form action="game.php" method="post"><br><br> <input type="submit" value="חזור למשחק" /> </form> <?php } elseif(isset($_POST["guessletter"])) { if(!isset($_SESSION["totalGuess"])) { $_SESSION["totalGuess"] = 0; } $totalGuess= 0; } $maxError=6; $wordList= rand(1,10); $pickedWord= $wordList if (!isset($_SESSION["word"])) ?> hanging man <br><br> <img src="0.jpg"/> <form action="game.php" method="post" > <font size="+6"><?php echo "_ _ _ _ _"; ?></font><br><br> <input type="text" name="guessletter" /> <input type="submit" name="guess" value= "guess"/> <br><br> <input type="submit" name="exit" value= "exit"/> </form> </body> </html>
  6. I am trying to make a hanging man game. I have ten words with 5 letters each. the program is supposed to choose one word out of the ten randomly and the user has to guess the letters and replace the underlines that appear on screen. the correct letters stay on screen. there is also a picture of the hanging man and with each mistake a body part appears- they get 6 tries or they fail. This is my code so far, it's a mess because I don't really know what i'm doing... (my ten words are in hebrew at the top) I'll really appreciate some help <?php session_start(); if ( !isset($_SESSION['word']) ) { $wordList="שולחן וילון מדפסת גיטרה פסנתר דרקון תרמיל בקבוק חולצה תמונה"; } ?> <html dir="rtl"> <body> <?php if(isset($_POST["exit"])) { ?> תודה ולהתראות! <br> <form action="game.php" method="post"><br><br> <input type="submit" value="חזור למשחק" /> </form> <?php } elseif(isset($_POST["guessletter"])) { if(!isset($_SESSION["totalGuess"])) { $_SESSION["totalGuess"] = 0; } $totalGuess= 0; } $maxError=6; $wordList= rand(1,10); $pickedWord= $wordList if (!isset($_SESSION["word"])) ?> איש תלוי <br><br> <img src="0.jpg"/> <form action="game.php" method="post" > <font size="+6"><?php echo "_ _ _ _ _"; ?></font><br><br> <input type="text" name="guessletter" /> <input type="submit" name="guess" value= "נחש"/> <br><br> <input type="submit" name="exit" value= "יציאה"/> </form> </body> </html> mod edit: meaningful title and put ending php code tag after the end of the code (edit2: unfortunately, the php code tag processing displays the foreign language characters as entities.)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.