Go Back > General Forums > Coding & Tutorials

Thread Tools
Old 12-02-2005, 06:09 AM   #1
Green Mole
Join Date: Dec 2005
Posts: 1
put 'include' in a table, within an echo, in php

Hoping for some assistance with some coding...

I would like to place an include command, into a table cell, that is with in an echo statement, with the <?php ?> area.

Here is a code snip, then I'll explain why I'm doing this...
<?php require 'db_connect.php';
if ($logged_in == 1) {echo '
<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2">
<td style="width: 150px;">Logged in as '.$_SESSION['username'].'<br><a href="logout.php">logout</a>
<td style="width: 500px;">Test</td>
<td>include "link_ControlPannel.html"</td>

include 'link_ControlPannel.html';

(please note, I'm not a programer - more of a coding hobbist. So I realize that my methods may not be polished.)

All of my code is with in the <?php ?> to prevent users from accessing the page if not logged in. I've been able to use tables, with borders at 0 or 1, to make the allignment of items on my page clean.

I would like to place the "include 'link_ControlPannel.html'" within the <td><?td>, as shown above, but cannot seem to get the include to actually display the code. Rather the statement "include 'link_ControlPannel.html'" is shown as text within the cell.

Only with the second include, show here as an example, is the code displayed properly (all the links). See attached pdf for how the page looks now. I woulld like to get the Control Pannel into the cell where you currently see the include statement.

thank you.
Attached Files
File Type: pdf IncludeHelp.pdf (3.4 KB, 3 views)
jmiter is offline   Reply With Quote
Old 12-27-2005, 04:39 AM   #2
Green Mole
Join Date: Dec 2005
Posts: 3
Well in you code you should do i think, is include("Link_ControlPanel.html"); i use a lot include in some other programs and this is the how i used, also i have not seem a code with require like you type include() and require() are php functions so the parameters must be between () like in my example, good look and hope this will help you
alexp_p is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
show results in an include (php) vuurvos How-to Forum 1 10-05-2005 07:44 AM
include search.php OceanSurf How-to Forum 1 09-08-2004 10:58 AM
How to use PHP include to include the Google result pages? sid Coding & Tutorials 1 01-07-2004 05:53 AM
Newbie : How to include PHP file (.php) frostbyte How-to Forum 1 01-04-2004 12:42 PM
Using PHP include in templates sid How-to Forum 3 11-23-2003 07:06 AM

All times are GMT -8. The time now is 02:33 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.