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"> </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>
That's because it's not PHP code...
That needs to go in an HTML article as that is what it is.
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?
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.
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.
Why not use SSI and call in the PHP file
How do I do that?
Please use the search ;)
http://docs.simplemachines.org/index.php?topic=400
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');
Tried the include but I get the original error, I will have to get it re-written.
Been looking at this, seems to me just put the code on its own page and call it within a iFrame in the article, I will try it out on our test site and get back asap
Edit. have a look at this: (http://www.tinyportal.net/index.php?page=11) that is in an Iframe
<center><iframe name="I1" src="http://www.tropicalfishforums.co.uk/files/ammoniaCalculator.php" width="457" height="384" align="middle" border="0" frameborder="0">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe></center>
Many thanks Lesmond, work a treat.
Your welcome, glad it worked :up: