0

I am working on a signup page in html. When I submit, I get the error " Parse error: syntax error, unexpected double-quoted string "> "" I have tried all other website with no help so please help. here is the PHP code, good.

$txt = "<!doctype HTML>
<html>
  <head>
    <form action="">
    <title>Welcome!!</title>
    <link rel='stylesheet' href='index.css'/>
  </head>
  <body>
    <div>
      <h1>Welcome!!</h1>
      <h4>We hope you enjoy using our website. So that you can <br>see the right things for your students, please answer<a href='#' style='text-decoration:none;'>A Few Questions</a></h4></div>
      <li>

    <h3>What sort of school do you run?</h3>
    
    <div>
        <input type='radio' name='question-1-answers' id='question-1-answers-A' value='A' />
        <label for='question-1-answers-A'> A Primary School </label>
    </div>
    
    <div>
        <input type='radio' name='question-1-answers' id='question-1-answers-B' value='B' />
        <label for='question-1-answers-B'> A Secondary School</label>
    </div>
    
    <div>
        <input type='radio' name='question-1-answers' id='question-1-answers-C' value='C' />
        <label for='question-1-answers-C'>A University</label>
    </div>
    <h3>What part of the Uk do you live in?</h3>
    
    <div>
        <input type='radio' name='question-2s-answers' id='question-1-answers-A' value='A' />
        <label for='question-1-answers-A'>England</label>
    </div>
    
    <div>
        <input type='radio' name='question-2-answers' id='question-1-answers-B' value='B' />
        <label for='question-1-answers-B'>Scotland</label>
    </div>
    
    <div>
        <input type='radio' name='question-2-answers' id='question-1-answers-C' value='C' />
        <label for='question-1-answers-C'>Wales</label>
    </div>
    <h3>Name of reward system</h3>
    <div>
        <input class='input'type='text' placeholder='Reward Name'></input>
    </div>
    <button onclick ='sub()'>Submit</button>"

Every time i submit it it shows the above error in the title. How to fix? Its on last line area. Im not what the problem is as there isnt even a ">" where it says it is

aynber
  • 22,380
  • 8
  • 50
  • 63
  • 2
    Since your large string is in double quotes, every time you use double-quotes (such as `
    `) you break the string. None of this needs to be in a PHP block, so close the PHP block before you echo this.
    – aynber Feb 23 '22 at 18:15
  • EOF might be a better option for you, https://3v4l.org/74koi If unfamiliar look at https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc – user3783243 Feb 23 '22 at 18:19

0 Answers0