Jump to content

Spray62

Members
  • Posts

    4
  • Joined

  • Last visited

Spray62's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks thara, I'm still new to this so any ideas what code it would be to alter it and stop it from all displaying on the one line?
  2. There is no db involved and as for the code I'm stuck on where to start with it. I briefly tried some GLOB code that I do not have on me right now and the images displayed but displayed all ten images horizontal across the page when It would need to be three horizontal then another 3 underneath etc. Any ideas on how to break them up so its three on each line? Or even the code needed to display them images using GLOB in general? Thanks
  3. Hi, I've been trying to display a group of images on a webpage that are saved in a folder. The directory of where the images are stored is images/gallery/flowers/ I'm stuck on what the small segment of PHP code would be to do this. Help would be greatly appreciated and thank you!
  4. Hi, Just to some up quickly I'm trying to create a simple two page quiz with an answer page and I'm stuck. This is just the rough code as you can see its only one question to try and get it to work before I add more questions. The aim is for the user to answer the questions on the first page then on the second page and the third page displays whether the answers were right or wrong. The code on the first page is <form name="input" action="quizpage2.php" method="post"> Username: <input type="text" name="user"> <p> In which film did Simon Pegg try and impress Thandie Newton by donning tight shorts and trainers? </p> <input type="radio" name='ans1' value="Hot Fuzz"/> Hot Fuzz<br /> <input type="radio" name='ans1' value="Good Luck Chuck"/> Good Luck Chuck<br /> <input type="radio" name='ans1' value="Run Fatboy Run"/> Run Fatboy Run<br /> <input type="submit" value="Page 2"> </form> The code on the second page is <?php session_start(); $_SESSION['ans1'] = $_POST['ans1']; ?> <form name="input" action="answers.php" method="post"> <p> What is Harry Potter? </p> <input type="radio" name='ans11' value="Wizard" /> Wizard<br /> <input type="radio" name='ans11' value="Goblin" /> Goblin <br /> <input type="radio" name='ans11' value="Troll" /> Troll<br /> <input type="submit" value="Submit"> </form> And then the answers page <?php session_start(); $_SESSION['ans1] = $_POST['ans1']; ?> <?php $ans1=$_SESSION['ans1']; if ($ans1 == "Run Fatboy Run") { echo "Correct"; } else { echo "Incorrect the answer is Run Fatboy Run"; } ?> All it shows on the answer page is "Incorrect the answer is Run Fatboy Run" even when I choose that as the answer. I'm not sure why it isn't working. Whether its the "sessions" I'm doing incorrect or using ' instead of " but I've tried everything and spent around 10 hours doing so. Much appreciated!
×
×
  • 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.