-1

I'm learning PHP from a range of different online tutorials. I'm trying to create a quiz which generates four different answers, with only one of them being correct. In this case it's answer four. This is how far I got with my code but I am having a hard time trying to print the HTML output, with me getting a T-String error.

<?php 
$n1 = rand (1, 99);
$n2 = rand (1, 99);
$n3 = rand (1, 99);
$n4 = '3';

print "Answers:<br />
<form>
<input type="radio">$n1<br />
<input type="radio">$n2<br />
<input type="radio">$n3<br />
<input type="radio">$n4</p>
<input type="submit">
</form>";
?>

From my research it seems to be about the fact that I am using slashes and quotes in my print but since I am trying to print HTML I don't know how to get around it?

halfer
  • 19,824
  • 17
  • 99
  • 186
Jimmy
  • 12,087
  • 28
  • 102
  • 192

1 Answers1

0

Your quoting is wrong. And ends here:

print "Answers:<br />
    <form>
    <input type=" //<<--
poletaew
  • 197
  • 2
  • 12
  • 5
    Questions that are about basic PHP syntax errors should not be answered. They should be closed as a duplicate of [PHP Parse/Syntax Errors; and How to solve them?](//stackoverflow.com/questions/18050071) only. See: [Should one advise on off topic questions?](//meta.stackoverflow.com/q/276572/1768232). Off-topic questions can be closed and deleted, which could nullify your contribution anyway. – John Conde Oct 09 '17 at 12:20