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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 327
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 220
  • Total: 221
  • tino

HTML in an article

Started by mattrat, August 19, 2007, 09:47:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mattrat

I have a custom action which displays a HTML table. I would like for that table to also be displayed in an article. I can copy and paste the code into the article and it works ok. But this would require me to update both tables. I want to be able to update only the one used in the custom action and it display the updates in the article.

What HTML code would I use in the article?

JPDeni

Where is the code for the custom action stored? If it's in a database table, you would be able to read the code from the table in a php article.

mattrat

Its  a HTML file in a folder in the root directory.

Can you show me what code?

JPDeni

Oh, I see. Your custom action is an html file. I thought it was php.

I'm not sure how to copy html into an article. I tend to avoid duplication whenever possible. Is there no way that you could dispense with the custom action and the html file and just use an article?

mattrat

#4
To make sure we are on the same page........

The custom action is here

http://arkhssports.net/index.php?action=scoreboard

The article is here

http://arkhssports.net/index.php

I have pasted the html into the article. this leaves me to edit two files. I would like for the atricle to display the file at http://arkhssports.net/scoreboard/index.html that is the same file that the action uses.

IchBin

In your php article include your html file.

include('path/to/your/file.html');

qw3r7yju4n

I get this error when i use your method there IchBin

Parse error: syntax error, unexpected $end in /nfsn/content/resurgence/public/SMForum/Sources/Load.php(1735) : eval()'d code(209) : eval()'d code on line 1

does this have something to do with the fact it is an excel sheet saved for web?

i am very new to using php...

JPDeni

Please paste the exact code you are using in your php article, so we can see what the problem is. My guess is that you didn't end your line with a ; but I can't be sure until I see it.

qw3r7yju4n

im trying to take a premade .HTML file and just put it in an article so it is actually in the portal, not a link to a nasty looking .html

all i used in the php-article was

include('path/to/your/file.html');

exactly... nothing else included.. is there something more i have to add since its not really html IN php?

Ken.

Try changing it to this to see if it works:

include("http://www.the_site/folder/page.html");

Point is this... a few times I've had to play around with the command to get it to pull the page.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

This website is proudly hosted on Crocweb Cloud Website Hosting.