|
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... ---snip--- <?php require 'db_connect.php'; if ($logged_in == 1) {echo ' <table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="width: 150px;">Logged in as '.$_SESSION['username'].'<br><a href="logout.php">logout</a> </td> <td style="width: 500px;">Test</td> <td></td> </tr> <tr> <td>include "link_ControlPannel.html"</td> <td></td> <td></td> </tr> </tbody> </table>'; include 'link_ControlPannel.html'; } ---snip-end--- (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. anyone? thank you. |
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
|
Thread Tools | |
|
|
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 |