Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unexpected End Error to Table

Posted on 2013-05-13
1
Medium Priority
?
285 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

782 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