PhpDig.net

Go Back   PhpDig.net > General Forums > Coding & Tutorials

Reply
 
Thread Tools
Old 12-02-2005, 06:09 AM   #1
jmiter
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.
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
alexp_p
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
Reply

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 06:23 AM.


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