Jump to content

Displaying content inside a table sourced via readfile


Kolusion
 Share

Recommended Posts

I am wanting HTML to render within a table and sourcing the data from another file. In an attempt to do this, I tried:

<TABLE class="main">
                <TR>
                        <TD>
                                <?php
                                        readfile('./1/index.html');
                                ?>
                        </TD>
                </TR>
        </TABLE>

 

This does not work and I am wondering if anyone knows how it can be done - or even if it can be done?

Link to comment
Share on other sites

That link is 404.

 

I tried:

        <TABLE class="main">
                <TR>
                        <TD>
                                <?php
                                        include('./1/index.html');
                                ?>
                        </TD>
                </TR>
        </TABLE>

.. but it didn't work.

Link to comment
Share on other sites

Try this...

 

<TABLE class="main">
                <TR>
                        <TD>
                                <?php
                                        include($_SERVER['DOCUMENT_ROOT'].'/1/index.html');
                                ?>
                        </TD>
                </TR>
        </TABLE>

 

You need to specify exactly where the file is located.

Link to comment
Share on other sites

Sure,

 

The root path is:

/var/www/test1.com/

 

The include\readfile path (the file I want being rendered into the table:

/var/www/test1.com/products/1/index.html

 

The HTML file in reference that holds the table called "main" we are talking about is:

/var/www/test1.com/products/index.html

Link to comment
Share on other sites

Okay, Try this:

 

<TABLE class="main">
                <TR>
                        <TD>
                                <?php
                                        include($_SERVER['DOCUMENT_ROOT'].'/products/1/index.html');
                                ?>
                        </TD>
                </TR>
        </TABLE>

Link to comment
Share on other sites

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

        "http://www.w3.org/TR/html4/strict.dtd">

<TITLE>X</TITLE>

<META content="charset=windows-1252;text/html" http-equiv="content-type">

<STYLE type="text/css">

BODY

	{

		background-attachment:fixed;

		background-image:url("/bodybackground.png");

		background-position:center;

		background-repeat:no-repeat;

		font-family:verdana

	}

IMG.logo

	{

		left:50%;

		margin-left:-635px;

		margin-top:-355px;

		position:absolute;

		top:50%

	}

SPAN.accountmenu

	{

		left:50%;

		margin-left:589px;

		margin-top:-352px;

		position:absolute;

		top:50%

	}

SPAN.mainmenu

	{

		left:50%;

		margin-left:374px;

		margin-top:-331px;

		position:absolute;

		top:50%

	}

A.silver

	{

		color:silver;

	}

TABLE.main

	{

		background-color:gold;

		height:636px;

		left:50%;

		margin-left:-635px;

		margin-top:-307px;

		position:absolute;

		top:50%;

		width:1270px

	}

A.legal

	{

		color:silver;

		left:50%;

		margin-left:-90px;

		margin-top:334px;

		position:absolute;

		top:50%

	}

</STYLE>

<DIV>

<IMG alt="" class="logo" src="../../../logo.png">

<SPAN class="accountmenu">

	<A class="silver" href="/login">Login</A>

</SPAN>

<SPAN class="mainmenu">

	<A class="silver" href="/contact">Contact</A> |

	<A class="silver" href="/information">Information</A> |

	<A class="silver" href="/products">Products</A>

</SPAN>

<TABLE class="main">

	<TR>

		<TD>

			<?php

				include('./1/index.html');

			?>

		</TD>

	</TR>

</TABLE>

<A class="legal" href="/legal">© X 2012</A>

</DIV>

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.