Re: strange echo() effect

From: Date: Thu, 31 Oct 2002 20:32:41 +0000
Subject: Re: strange echo() effect
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-122320@lists.php.net to get a copy of this message
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...

« previous php.general (#122320) next »