Solved

Unexpected End Error to Table

Posted on 2013-05-13
1
275 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 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now