473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How do I debug this error?

I'm a beginner and this is my class assignment.
PHP reports the following error when tried to run the program,
Parse error: syntax error, unexpected T_IF in C:\xampp\htdocs\untitled.php on line 118.

How do I debug the error?

Here's a snippet of the code:

<p>&nbsp;</p>
<table width="800" border="1" align="center" bordercolor="#000000">

<tr bgcolor="#DD3557">
<th colspan="2" class="style12" scope="col">And our comments for this conversion are as follow: </th>
</tr>
<tr>
<td width="50%"><span class="style27">Great than or equal <?= $greaterthanorequal ?> </span></td>
<td width="50%">
<?=
LINE 118 --> if ($conversion >= $greaterthanorequal)
{
echo "<font color=#FF0000>$comment1</font>";
}
else
{
echo "$comment1";
}
?>

</td>
</tr>
<tr>
<td><span class="style27">Between <?= $between1 ?> to <?= $betweeen2 ?> </span></td>
<td>
<?=
if(($conversion >= $between1) and ($converted <= $between2))
{
echo "<font color=#FF0000>$comment2</font>";
}
else
{
echo "$comment2";
}
?>

</td>
</tr>
<tr>
<td><span class="style27">Less than or equal <?= $lessthanorequal ?></span></td>
<td>
<?=
if($conversion <= $lessthanorequal)
{
echo "<font color=#FF0000>$comment3</font>";
}
else
{
echo "$comment3";
}
?>

</td>
</tr>
</table>
May 28 '08 #1
1 1048
Markus
6,050 Expert 4TB
When posting please use code tags.
Revise your code and do so.

Also, it would be helpful to know what line 118 is.

The error is that you do this:
[php]
<?=
if( ...
[/php]
You cant use that short tag in that situation: <?= is used to echo a variable - nothing else.

[php]
<?= $variable?> // works
<?= if($foo == $bar) ... ?> // wont work.
[/php]
May 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mike C. Fletcher | last post by:
Every few months I get to working on a Python C extension (built with distutils) and discover a pointer error or the like where I'd like to be able to step into my DLL and see where the extension...
5
by: David++ | last post by:
Hi there, I have built a DLL in Visual C++ 6. When I build the DLL it builds fine for the debug version of the DLL (and this DLL works fine), however, I seem unable to build a Release version of...
4
by: Stephen Miller | last post by:
Hi, I am running v1.1.4322 on Win2K server and unable to debug a ASP.Net application running locally, using a full URL (ie www.mysite.com). When I hit F5, I get the following error message: ...
4
by: Angel | last post by:
I am trying to debug a simple asp.net project using Visual Studio.net(2002) and receive the following error: Error while tring to run project. Unable to start debugging on the web server....
2
by: NAGY | last post by:
hello, I created an asp.net web app in C# from a non administrative account in Visual Studio 2003, .net 1.1. when i try to run the application in debug mode from Debug start menu option, i get an...
8
by: Fred Flintstone | last post by:
I have an odd problem. I'm beating myself bloody trying to get debugging to work. I have VS.Net 2005 installed on a Windows XP SP2 workstation and on a W2003 Server. The asp.net application is...
5
by: B. | last post by:
We just recently move to code from VC++6 to VC++.NET 2005 and upgrade the warning level from 3 to 4. In debug mode, we compile the application with no warning no error, but when I build it in...
6
by: Andrew Rowley | last post by:
I am having trouble getting debug and release builds to work properly with project references using C++ .NET and Visual Studio 2003. I created a test solution, with a basic Windows form C++...
3
by: rorni | last post by:
Hi, I'm porting code from Windows to HP-UX 11, compiling with g++. I'm getting a compilation error on the system's debug.h include file, which is included very indirectly through a series of...
2
by: joelkeepup | last post by:
Hi, I made a change this morning and now im getting an error that says either "a is undefined or null" or "e is undefined or null" the microsoft ajax line is below, I have no idea how to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.