mabwriter
mabwriter

Reputation: 19

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/a6910668/public_html/event.php on line 83

I've looked at every other question involving this topic, but they are all in different situations, and I've tried to follow some of their tips to no avail. This is my code. The supposed error line is in bold.

echo " </select> :
<select name=\"event_time_mm\">
<option value=\"00\">00</option>
<option value=\"15\">15</options>
<option value=\"30\">30</options>
<option value=\"45\">45</options>
</select>
<input type=\"hidden\" name=\"m\" value=\"".$m"\">
**<input type=\"hidden\" name=\"d\" value=\"".$d"\">**
<input type=\"hidden\" name=\"y\" value=\"".$y"\">
<br/><br/>
<input type=\"submit\" name=\"submit\" value=\"Add Event\">
</form>";

Upvotes: 0

Views: 3673

Answers (3)

Tim Fountain
Tim Fountain

Reputation: 33148

Just to present another option, the heredoc syntax is quite nice for multi-line strings like this, e.g.:

echo <<<EOD
   <input type="hidden" name="m" value="$m">
   **<input type="hidden" name="d" value="$d">**
   <input type="hidden" name="y" value="$y">
EOD;

Upvotes: 1

mario
mario

Reputation: 145482

Addendum: If you are already using double quotes, you should avoid the concatenation operator and switching in and out of the string altogether:

echo "
   <select>
   <input type=\"hidden\" name=\"m\" value=\"$m\">
   </form>";

Works the same.

Upvotes: 0

Shakti Singh
Shakti Singh

Reputation: 86406

you are missing concatenation . with variables $m, $d ,$y

value=\"".$m."\">

add . after all these three variables.

Upvotes: 4

Related Questions