?
Solved

Unexpected End Error to Table

Posted on 2013-05-13
1
Medium Priority
?
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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ā€¦
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

719 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