Here is my code, I understand that it is important to not mix html and php together on the same lines, but I can't get my head around this! Can anyone be of assistance? I have tried a few alternatives but I keep getting the syntax error unexpected '}'.
    <?php //Creating random number s
     $rid = rand(1,3); 
     echo $rid; if ($rid == 1){ ?>
     <form action="<?php echo base_url(); ?>index.php/welcome/result" method='post' id='quizForm' id='1'>
    <input type="hidden" name="id" value="1"/>
    <ol>
    <li>
    <h3>What does PHP stand for?</h3>
    <div>
    <input type='radio' name='answerOne' id='answerOne' value='A' />
    <label for='answerOneA'>A) Hyper text markup language</label>
    </div>
    <div>
    <input type='radio' name='answerOne' id='answerOne' value='B' />
    <label for='answerOneB'>B) PHP: Preprocessed hypertext</label>
    </div>
    <div>
    <input type='radio' name='answerOne' id='answerOne' value='C' />
    <label for='answerOneC'>C) PHP: Hypertext Preprocessor</label>
    </div>
    </li>
    <li>
    <h3>Who invented PHP?</h3>
    <div>
    <input type='radio' name='answerTwo' id='answerTwo' value='A' />
    <label for='answerTwoA'>A) Dick Dastardly </label>
    </div>
    <div>
    <input type='radio' name='answerTwo' id='answerTwo' value='B' />
    <label for='answerTwoB'>B) Rasmus Lerdof</label>
    </div>
    <div>
    <input type='radio' name='answerTwo' id='answerTwo' value='C' />
    <label for='answerTwoC'>C) God</label>
    </div>
    </li>
     <li>
    <h3>What is PHP used for?</h3>
    <div>
    <input type='radio' name='answerThree' id='answerThree' value='A' />
    <label for='answerThreeA'>A) Creating dynamic webpages</label>
    </div>
    <div>
    <input type='radio' name='answerThree' id='answerThree' value='B' />
    <label for='answerThreeB'>B) Server-side scripting</label>
    </div>
    <div>
    <input type='radio' name='answerThree' id='answerThree' value='C' />
    <label for='answerThreeC'>C) All of the above</label>
    </div>
    </li>
    </ol>
    <input type='submit' value='Submit Answers' />
    </form>
    <?php
     }
     ?>
 
    