Solved

Unexpected End Error to Table

Posted on 2013-05-13
1
278 Views
Last Modified: 2013-05-13
I am getting an unexpected end error to this.....
<div id="BigPlace">
<?php
include('config.php');
$Alpha=$_POST['Alpha']= mysql_real_escape_string($_POST['Alpha']);
?>
		<?php
		error_reporting(E_ALL);

		 switch ($Alpha)
					{
					case "1":
						$html = <<<EOD
						<div id="BigName">Number 1</div>
						<table>
						<tr>
						<td>Row 1, cell 1</td>
						<td>Row 1, cell 2</td>
						</tr>
						<tr>
						<td>Row 2, cell 1</td>
						<td>Row 2, cell 2</td>
						</tr>
						</table>
						EOD;
						break;
					case "2":
						$html = <<<EOD
						<div id="BigName">Number 2</div>
						<table>
						<tr>
						<td>Row 1, cell 1</td>
						<td>Row 1, cell 2</td>
						</tr>
						<tr>
						<td>Row 2, cell 1</td>
						<td>Row 2, cell 2</td>
						</tr>
						</table>
						EOD;
						break;
					}
						echo $html;
					?>
</div>

Open in new window

0
Comment
Question by:DS928
1 Comment
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39161647
Please see the man page: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

The end signal for HEREDOC must start in column 1.

Also, you probably want to provide for a default value in  case the expected values of 1 or 2 are not received.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question