Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your initial code appears to be missing a closing "select" tag which may be causing the syntax error.</p> <p>Instead, you could try a somewhat cleaner approach by only using PHP where necessary (saves escaping all of the quotation marks).</p> <pre><code>&lt;form method="post" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;"&gt; &lt;p&gt;&lt;strong&gt;Event Time (hh:mm):&lt;/strong&gt;&lt;/p&gt;&lt;/br /&gt; &lt;select name="event_time_hh"&gt; &lt;?php for ($y=1; $y&lt;=24; $y++) { echo "&lt;option value=\"$y\"&gt;$y&lt;/option&gt;"; } ?&gt; &lt;/select&gt; &lt;p&gt;&lt;strong&gt;Event end (hh:mm):&lt;/strong&gt;&lt;/p&gt;&lt;/br /&gt; &lt;select name="event_time_hh"&gt; &lt;?php for ($x=1; $x&lt;=24; $x++) { echo "&lt;option value=\"$x\"&gt;$x&lt;/option&gt;"; } ?&gt; &lt;/select&gt; &lt;select name="event_time_mm"&gt; &lt;option value="00"&gt;00&lt;/option&gt; &lt;option value="15"&gt;15&lt;/option&gt; &lt;option value="30"&gt;30&lt;/option&gt; &lt;option value="45"&gt;45&lt;/option&gt; &lt;/select&gt; &lt;select name="event_end_mm"&gt; &lt;option value="00"&gt;00&lt;/option&gt; &lt;option value="15"&gt;15&lt;/option&gt; &lt;option value="30"&gt;30&lt;/option&gt; &lt;option value="45"&gt;45&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" name="submit" value="Add Event" /&gt; &lt;/form&gt; </code></pre> <p>In addition, you could check whether the form has been submitted - then validate and process the input.</p> <pre><code>&lt;?php // Check to see if form has been submitted. if (isset($_POST['submit'])) { /* Some validation should be performed here to ensure the following * values have actually been selected prior to form being submitted. */ $event_time_hh = $_POST['event_time_hh']; $event_time_mm = $_POST['event_time_mm']; $event_end_hh = $_POST['event_end_hh']; $event_end_mm = $_POST['event_end_mm']; } ?&gt; </code></pre>
    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. This table or related slice is empty.
    1. 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