Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Error reporting will have not included notices on the previous server which is why you haven't seen the errors.</p> <p>You should be checking whether the index <code>s</code> actually exists in the <code>$_GET</code> array before attempting to use it.</p> <p>Something like this would be suffice:</p> <pre><code>if (isset($_GET['s'])) { if ($_GET['s'] == 'jwshxnsyllabus') echo "&lt;body onload=\"loadSyllabi('syllabus', '../syllabi/jwshxnporsyllabus.xml', '../bibliographies/jwshxnbibliography_')\"&gt;"; else if ($_GET['s'] == 'aquinas') echo "&lt;body onload=\"loadSyllabi('syllabus', '../syllabi/AquinasSyllabus.xml')\"&gt;"; else if ($_GET['s'] == 'POP2') echo "&lt;body onload=\"loadSyllabi('POP2')\"&gt;"; } else { echo "&lt;body&gt;"; } </code></pre> <p>It may be beneficial (if you plan on adding more cases) to use a <code>switch</code> statement to make your code more readable.</p> <pre><code>switch ((isset($_GET['s']) ? $_GET['s'] : '')) { case 'jwshxnsyllabus': echo "&lt;body onload=\"loadSyllabi('syllabus', '../syllabi/jwshxnporsyllabus.xml', '../bibliographies/jwshxnbibliography_')\"&gt;"; break; case 'aquinas': echo "&lt;body onload=\"loadSyllabi('syllabus', '../syllabi/AquinasSyllabus.xml')\"&gt;"; break; case 'POP2': echo "&lt;body onload=\"loadSyllabi('POP2')\"&gt;"; break; default: echo "&lt;body&gt;"; break; } </code></pre> <p>EDIT: BTW, the first set of code I wrote mimics what yours is meant to do in it's entirety. Is the expected outcome of an unexpected value in <code>?s=</code> meant to output no <code>&lt;body&gt;</code> tag or was this an oversight? Note that the switch will fix this by always defaulting to <code>&lt;body&gt;</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload