TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 351
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 301
  • Total: 302
  • @rjen

Parse error: syntax error, unexpected '<'

Started by clothahump, November 15, 2009, 10:06:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

clothahump

Tried adding a php page using the following code and got error

Parse error: syntax error, unexpected '<'  in /home/tropical/public_html/Themes/default/TPortal.template.php(586) : eval()'d code on line 1

<form action="http://www.tropicalfishforums.co.uk/files/ammoniaCalculator.php" method="post">
<table class="tborder">
<tbody><tr class="tcat">
<th colspan="2" align="center">Ammonia Strength Calculator</th>
</tr>

<tr>
<th align="right">Ammonia Strength:</th>
<td><input name="ammoniaStrength" class="bginput" size="2" value="9" type="text">%</td>
</tr>
<tr>
<th align="right">Volume of Tank:</th>
<td><input name="tankVolume" class="bginput" size="5" value="100" type="text">Litres</td>
</tr>
<tr>
<th align="right">Required ppm:</th>
<td><input name="ppmRequired" class="bginput" size="2" value="3" type="text"></td>
</tr>
<tr>
<th align="right">Existing ppm:</th>
<td><input name="ppmExisting" class="bginput" size="2" value="0" type="text"></td>
</tr>
<tr>
<th align="right"></th>
<td><input name="submitButton" class="button" value="Calculate" type="submit"></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr class="tcat">
<th colspan="2" align="center">
Please enter Ammonia Strength, tank size and required ppm above. </th>

</tr>
<tr>
<td colspan="2">
<b>N.B.
<ul>
<li>To be used as a guide only</li>
<li>Assumes 0ppm Ammonia as a starting point</li>
<li>Always double check your calculation elsewhere</li>
<li>No liability will be held for incorrect input/output</li>
</ul>
</b>
</td>
</tr>
</tbody></table>
</form>

Freddy

That's because it's not PHP code...

That needs to go in an HTML article as that is what it is.

clothahump

Thanks Freddy, changed it to HTML and it now works but result opens in new page with no TP wrapper, any way to fix it?

Freddy

#3
Yeah, it looks like your ammoniaCalculator.php is an external file so it will do - it's not going to know it's part of TP by itself.

I have to go out now but what you could do is try transferring the content of ammoniaCalculator.php into A TP PHP article, then change your form so it points to that page instead, something like this depending on the path to your forum, my guess is :

<form action="http://www.tropicalfishforums.co.uk/forum/index.php?page=45" method="post">

Where '45' is the page on TP - so whatever that is replace it and amend the path to point to wherever your forum is located.

I'm assuming the ammonia page doesn't call on other files and is just some simple PHP.

clothahump

The so called PHP file is actually a mix of PHP and HTML, I am unable to get it working so will try and find an alternative that does work.

G6Cad




IchBin

I think you have misunderstood what this person is asking G6. You can't use SSI to include a file.

I would suggest you try another solution as you suggested, or just try including the file with the include() statement in a php article.

include('path/to/file.php');

clothahump

Tried the include but I get the original error, I will have to get it re-written.

This website is proudly hosted on Crocweb Cloud Website Hosting.