Solved

Unexpected End Error to Table

Posted on 2013-05-13
1
281 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 110

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

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…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

630 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