Re: Re: strange echo() effect
| From: | Mat Harris | Date: | Thu, 31 Oct 2002 21:13:10 +0000 |
| Subject: | Re: Re: strange echo() effect | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122332@lists.php.net to get a copy of this message | ||
DOH!
<tail-betweek-legs>
think i'll keep myself to myself from now on
</tail-betweek-legs>
On Thu, Oct 31, 2002 at 09:32:41PM +0100, BAROILLER Pierre-Emmanuel wrote:
> You've forgotten the "</table>" in your echo...
> html_header() and html_footer() put html in the right place in your page
> but, like you haven't close your <table> tag,
> the footer dans be everywhere in your page (depends on the web browser
> you're using)..
>
> Regards,
> P.E. Baroiller
>
> I have a small piece of code which does the following:
>
> 1) call a function to print an html header,
> 2) query a database to list the users in the db,
> 3) print an html footer.
>
> problem is it print out the footer before the table, even though it is
> called after. looking at the html source of the page in a browser, show that
> the table is first, why is this happening? here is the code:
>
> html_header();
> echo "<table border=\"1\" width=\"80%\" cellpadding=\"0\"
> cellspacing=\"0\">\n";
> echo "<tr>\n";
> echo "<td><b>uid</b></td>\n";
> echo "<td><b>username</b></td>\n";
> echo "<td><b>password</b></td>\n";
> echo "<td><b>session id</b></td>\n";
> echo "<td><b>email address</b></td>\n";
> echo "</tr>\n";
> $query = "SELECT * FROM users LIMIT 0,30";
> $result = mysql_query($query);
> while ($query_data = mysql_fetch_row($result))
> {
> echo "<tr>\n";
> foreach ($query_data As $column)
> {
> echo "\t<td>$column</td>\n";
> }
> echo "</tr>\n";
> }
> echo "<br><br>\n";
> html_footer();
>
> --
> Mat Harris OpenGPG Public Key ID: C37D57D9
> mat.harris@genestate.com matthewh.genestate.com
>
> "Mat Harris" <mat.harris@genestate.com> a écrit dans le message de news:
> 20021031202620.GA3619@genestate.com...
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Mat Harris OpenGPG Public Key ID: C37D57D9
mat.harris@genestate.com matthewh.genestate.com