![]() |
PHP Issues.
I'm having some issues using PHP to dynamically create a table...
Basically it reads imagenames from a folder, then creates a table and has 3 items per row. It creates a new row every 3 items, or should... That's the problem, the "<tr>"'s and "</tr>"'s never get printed... Here's the code: PHP Code:
Also, sorry for any particularly bad code, i'm just learning ;) Also, this can be tested at: http://revts.ath.cx while i am online (Pass: Password) EDIT: Also, the 0 never shows beneath the first image... EDIT2: Fixed the 0 never being shown... Code above amended (used i == instead of i =) |
Re: PHP Issues.
if (($Filename != ".") AND ($Filename != "..")) ++$i;;
I do in that line, it works fine, and the numbers do count up, yet the html doesn't get written... :erm: Fixed declaring as a string now too, thanks :) EDIT: Could have sworn i saw a post by punky above this... ---------- Post added at 00:06 ---------- Previous post was yesterday at 23:54 ---------- Ah man i'm a dunce... Forgot to use the dollar sign $ before the i in the if statments to print the html... Think i'm too tired... |
Re: PHP Issues.
Yeah, I did post, but I spotted the ++$i after mine and before yours, so I deleted it. Alas too late.
The <tr>s don't get printer is because you have i instead of $i The code is really weird though. ---------- Post added at 23:15 ---------- Previous post was at 23:13 ---------- Also, another prob I spotted... your <tr> closing tag should be </tr> not <\tr>. A backslash within a string is a special character. In this case \t = tab. |
Re: PHP Issues.
Fully functional (abeit badly written) code:
Code:
<?php---------- Post added at 00:18 ---------- Previous post was at 00:15 ---------- Quote:
EDIT: Also changed the closing TR tag code to: Code:
if ($i == 4) print ("<//\tr>") AND $i = 0; |
Re: PHP Issues.
Can anyone just take a peek at it? So i can get some feedback...
http://revts.ath.cx Password: Authentic8 |
Re: PHP Issues.
This makes no sense, what is it supposed to do ?
Quote:
|
Re: PHP Issues.
Quote:
Works fine, though it looks odd. |
Re: PHP Issues.
Your coding of PHP is far different to mine thats for sure... Its not structured like I structure PHP at all. No wonder you're finding it difficult. Each function should be on its own line ideally. It makes it easy to troubleshoot.
|
| All times are GMT. The time now is 21:52. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum