PHP Script output to an HTML table
Moderator: General Moderators
PHP Script output to an HTML table
I am very new at this, and I want to know first of all if this can even be done...
I have a standard HTML page, I know that I can just put PHP tags in it, save it as a .php and it will display the same as if it were the original HTML page.
This page has a table with 3 columns, in the left column/cell I would like to invoke a PHP file that has an output.
The PHP script I have is a RSS parser, formatter, it works just fine when I invoke it stand alone and produces it's link to the browser. I just simply want to direct that same output to the confines of my table/cell.
Is this possible?
I don't expect anyone to write any code for me, but if it is possible... please point me in the right direction and I will try to figure it out. I have seen functionality like this on Nuke, but only desire this content in a simple page, don't need an entire CMS site.
There is no MySQL data here, just link/HTML output from a cached file on the server.
I have a standard HTML page, I know that I can just put PHP tags in it, save it as a .php and it will display the same as if it were the original HTML page.
This page has a table with 3 columns, in the left column/cell I would like to invoke a PHP file that has an output.
The PHP script I have is a RSS parser, formatter, it works just fine when I invoke it stand alone and produces it's link to the browser. I just simply want to direct that same output to the confines of my table/cell.
Is this possible?
I don't expect anyone to write any code for me, but if it is possible... please point me in the right direction and I will try to figure it out. I have seen functionality like this on Nuke, but only desire this content in a simple page, don't need an entire CMS site.
There is no MySQL data here, just link/HTML output from a cached file on the server.
Last edited by wknit on Sat May 31, 2003 11:57 am, edited 1 time in total.
Thats really easy...
Just put your script inside the table cell you want your link to show up.
<table>
<tr>
<td> <?php //script here ?></td>
<td></td>
<td></td>
</tr>
The script will now show up right in the table cell...
Jade
Just put your script inside the table cell you want your link to show up.
<table>
<tr>
<td> <?php //script here ?></td>
<td></td>
<td></td>
</tr>
The script will now show up right in the table cell...
Jade
Last edited by Jade on Sun May 25, 2003 2:05 pm, edited 1 time in total.
I'm not sure I got the point but....as an example of how to embed php-code into a table cell
Code: Select all
<html>
<body>
<table>
<tr>
<td style="background-color: red;">
</td>
<td style="background-color: green;">
</td>
<td>
<fieldset><legend><?php echo $_SERVER['SCRIPT_FILENAME']; ?></legend>
<pre><?php highlight_file($_SERVER['SCRIPT_FILENAME']); ?></pre>
</fieldset>
</td>
</tr>
</table>
</body>
</html>I think you understood perfectly, what I want to do is call a php script on disk to run within the context and display it's output in a table cell.
I tried your example but it didn't work, I am assuming that 'SCRIPT_FILENAME' is the same file name in both instances. I get an error when the server attempts to parse the "highlight_file" line.
Any suggestions?
I tried your example but it didn't work, I am assuming that 'SCRIPT_FILENAME' is the same file name in both instances. I get an error when the server attempts to parse the "highlight_file" line.
Any suggestions?
Thanks!volka wrote:I'm not sure I got the point but....as an example of how to embed php-code into a table cellCode: Select all
<html> <body> <table> <tr> <td style="background-color: red;"> </td> <td style="background-color: green;"> </td> <td> <fieldset><legend><?php echo $_SERVER['SCRIPT_FILENAME']; ?></legend> <pre><?php highlight_file($_SERVER['SCRIPT_FILENAME']); ?></pre> </fieldset> </td> </tr> </table> </body> </html>
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
and what doestell you about the version of php?
Code: Select all
<?php phpinfo(); ?>What I am running..
Apache/1.3.26 (Unix) (Red-Hat/Linux) mod_ssl/2.8.9 OpenSSL/0.9.6 PHP/4.1.1 mod_perl/1.24_01 FrontPage/5.0.2.2510 on Linux.
Thanks for all your help so far!
Thanks for all your help so far!
- discobean
- Forum Commoner
- Posts: 49
- Joined: Sun May 18, 2003 9:06 pm
- Location: Sydney, Australia
- Contact:
if you want to just run a script from another file try this:wknit wrote:what I want to do is call a php script on disk to run within the context and display it's output in a table cell.
Code: Select all
<table>
<tr>
<td><?php require_once('phpfilename.php'); ?></td>
</tr>
</table>Marz.