Re: dhtml within php
| From: | Becoming Digital | Date: | Fri, 23 May 2003 19:01:01 +0000 |
| Subject: | Re: dhtml within php | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27998@lists.php.net to get a copy of this message | ||
You've got some major syntax problems there, the most obvious of which is
starting a new print() tag without closing the first one. You also needed to
rethink the syntax of all your quotes, as there are/were a great many problems
in the link portion alone.
I've included below a slightly edited piece of your code to get you on the right
track. I recommend that you look very closely at that quote syntax, as what I
gave you isn't perfect, either, but at least this will display *something* if
you take it out of the for() loop.
<?
for($i = 1; $i=$tableLayout->ntab;$i++) {
print '<div id="Tab[$i]" class="tab" style="position:absolute;
left:80*[$i]px; top:185px; width:80px; height:20px; z-index:1;
visibility:visible">';
print '<a href="\'Tab[$i]\',\'Folder[$i]\'">Table
1</a></div>';
}
?>
Edward Dudlik
Becoming Digital
www.becomingdigital.com
----- Original Message -----
From: "Robbie Staufer" <rstaufer@scd.ucar.edu>
To: <php-db@lists.php.net>
Sent: Thursday, 22 May, 2003 17:01
Subject: [PHP-DB] dhtml within php
Hello,
I'm working on a web page that displays the tables of a database and
their contents. The php script for accessing the database and
displaying the tables is in place. Now I want to manipulate the web
page layout so that the db tables are displayed in a series of folders
with tabs, with the current table being visible. I can't get the right
syntax for printing out <div>s within a php loop. Here's what I have ...
for($i = 1; $i=$tableLayout->ntab;$i++) {
// create tabs
print('<div id="Tab[$i]" class="tab"
style="position:absolute; left:80*[$i]px; top:185px;
width:80px;
height:20px; z-index:1; visibility:visible">
<a
href="javascript:turnOn('Tab[$i]','Folder[$i]')">Table 1</a>
print('</div>');
The code for the folders containing the db tables is similar. The
function turnOn() is defined in the header, along with a javascript
function for switching tabs and tables when the user clicks a tab. Is
this a big syntax problem, or do I need to take a different approach?
Thanks,
Robbie
--
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Robbie Staufer
NCAR/SCD
1850 Table Mesa Dr. Rm. 42
Boulder, CO. 80305
(303) 497-1836
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php