Parse error... I'm going crazy

Codes here !

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Thu Feb 23, 2012 7:52 am

Parse error... I'm going crazy

Postby Chrisbbw » Wed Oct 10, 2012 2:43 am

Hello guys,

I have this code

Code: Select all


$submit = $_POST['submit'];

if (isset($submit)) {
   mysql_query("INSERT INTO eflyers (name, date, html_source, subject_line, sent_date, resort)
      VALUES ('$_POST[eflyer-name]','$_POST[eflyer-date]','$_POST[html-source]','$_POST[subject-line]','$_POST[sent-date]','$_POST[resort]')");    ?>
   <div id="success">
      <p>The e-flyer has been correctly added to the database.</p>
<?php } ?>

All I have in return is:

Code: Select all

Parse error: syntax error, unexpected '-', expecting ']' in ... on line 21

I don't know what to do!

User avatar
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Parse error... I'm going crazy

Postby egami » Wed Oct 10, 2012 8:07 am

Change your form to be underscore and not a hyphen.

should be

Hyphen's are No-No's in PHP variables.

Return to “mySQL & php coding”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests