Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [wolontariat]PHP losowy quiz, Losowe wersje quizu
Lewy1337
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 1.03.2017

Ostrzeżenie: (0%)
-----


Witam, pierwszy raz zabrałem się za stworzenie strony w PHP, gdyż muszę ją przygotować do szkoły, niestety nie znam nawet podstawowych komend ale potrzebuję rozwiązania na piątek i nie mam aktualnie zbytnio czasu żeby zagłębić się w tym temacie (IMG:style_emoticons/default/smile.gif) Mógłby mi ktoś powiedzieć jak zrobić abym nie miał 2 wersji quizu tylko jedną wybraną ? Chciałbym mieć tylko jeden quiz stały ale nie wiem na co zmienić $rid = rand(1,2); (IMG:style_emoticons/default/smile.gif)
Kod
<html>
<head>
<style type='text/css'>
#quiz {
    
    width:950px;
     height:auto;
     padding: 13px;
     margin-right:auto;
     margin-left:auto;
     background-color:#fff;
    
}
</style>
</head>

<body bgcolor='#e1e1e1'>

<?php

    $rid = rand(1,2);
    echo $rid;
?>

<div id='quiz'>

<center><font face='Andalus' size='5'><b>Quiz sieci Wi-Fi<br>wykonany przez<br>ssssi</b></font></center>
<br />
<br />
<br /><br />

<?php

if ($rid == 1){
    
    echo "
<form action='process.php?id=1' method='post' id='quizForm' id='1'>


    <ol>
    
  
        <li>
        <h3>Golec to</h3>
        
        <div>
        <label for='answer1'>Golec ma na imię </label><input type='text' name='answerOne' id='answerOne' value='' />
        
        </div>
        </li>
        
    
        <li>
        <h3>Podlaś</h3>
        
        <div>
        <input type='radio' name='answerTwo' id='answerTwo' value='A' />
        <label for='answerTwoA'>A)Piotrek</label>
        </div>
        
        <div>
        <input type='radio' name='answerTwo' id='answerTwo' value='B' />
        <label for='answerTwoB'>B)Dawid</label>
        </div>
        
        <div>
        <input type='radio' name='answerTwo' id='answerTwo' value='C' />
        <label for='answerTwoC'>C)Adi</label>
        </div>
        </li>
        
      
        
         <li>
        <h3>Pala</h3>
        
        <div>
        <input type='radio' name='answerThree' id='answerThree' value='A' />
        <label for='answerThreeA'>A)Marceli </label>
        </div>
        
        <div>
        <input type='radio' name='answerThree' id='answerThree' value='B' />
        <label for='answerThreeB'>B) Michał</label>
        </div>
        
        <div>
        <input type='radio' name='answerThree' id='answerThree' value='C' />
        <label for='answerThreeC'>C) Adam</label>
        </div>
        </li>
    </ol>
     <input type='submit' value='Submit Quiz' />
    
</form>";

}

if ($rid == 2){
    
    echo "


<form action='process.php?id=2' method='post' id='quizForm' id='2'>


    <ol>
    
    
        <li>
        <h3>3</h3>
        
        <div>
        <input type='radio' name='answerOne' id='answerOne' value='A' />
        <label for='answerOneA'>A)Cascading Style Sheet</label>
        </div>
        
        <div>
        <input type='radio' name='answerOne' id='answerOne' value='B' />
        <label for='answerOneB'>B) Hyper turn mark lingo</label>
        </div>
        
        <div>
        <input type='radio' name='answerOne' id='answerOne' value='C' />
        <label for='answerOneC'>C) Happy tissue mahatma life</label>
        </div>
        </li>
        
      
        <li>
        <h3>2</h3>
        
        <div>
        <input type='radio' name='answerTwo' id='answerTwo' value='A' />
        <label for='answerTwoA'>A)Video sharing website </label>
        </div>
        
        <div>
        <input type='radio' name='answerTwo' id='answerTwo' value='B' />
        <label for='answerTwoB'>B)A Search Engine</label>
        </div>
        
        <div>
        <input type='radio' name='answerTwo' id='answerTwo' value='C' />
        <label for='answerTwoC'>C) None of the above</label>
        </div>
        </li>
        
      
         <li>
        <h3>1</h3>
        
        <div>
        <input type='radio' name='answerThree' id='answerThree' value='A' />
        <label for='answerThreeA'>A)No One </label>
        </div>
        
        <div>
        <input type='radio' name='answerThree' id='answerThree' value='B' />
        <label for='answerThreeB'>B)Akon</label>
        </div>
        
        <div>
        <input type='radio' name='answerThree' id='answerThree' value='C' />
        <label for='answerThreeC'>C)Barack Hussain Obama </label>
        </div>
        </li>
    </ol>
     <input type='submit' value='Submit Quiz' />
    
</form>
";
}

?>
</div>

</body>
</html>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 06:07