php - when all fields are empty, echo and exit - by newbie -


please tell me needs done, avoid message:

parse error: syntax error, unexpected $end in /xxxx/xxxxxxx/public_html/contact-    it/feedback.php on line xxx (the last line of feedback.php = ?>) 

thanks hint.

if(empty($data_start)) {      if(empty($data_end)) {          if(empty($comment)) {          # empty  echo "you have not specified details submit us";     exit ;  ?> 

you missing closing curly braces:

if(empty($data_start)) {      if(empty($data_end)) {          if(empty($comment)) {          # empty  echo "you have not specified details submit us";     exit(); }}} 

you should re-factor code this:

if(empty($data_start) && empty($data_end) && empty($comment)){     exit("you have not specified details submit us"); } 

more info:


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -