Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php code/output within html table

Status
Not open for further replies.

skottieb

Programmer
Jun 26, 2002
118
0
0
AU
hi,
it there anything special with php code in tables.
Look at the following:

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot;>
<html>
<head>
<title>Participant Search Results</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;Quanta Plus&quot;>
</head>
<body bgcolor=&quot;darkBlue&quot; text=&quot;white&quot; link=&quot;red&quot; alink=&quot;yellow&quot; vlink=&quot;lightGray&quot;>
<table width=&quot;100%&quot; cellspacing=0 border=0 cellpadding=0 align=&quot;center&quot; bgcolor=&quot;blue&quot;>
<tr align=&quot;center &quot; valign=&quot;center&quot; bgcolor=&quot;white&quot;>
<td><?php
$name = $HTTP_POST_VARS['user'];
$users = &quot;registered_users.txt&quot;;

if(($reg = file($users, &quot;r&quot;)) == FALSE)
{
print(&quot;<h2>Error opening $users, probably not found</h2>&quot;);
}else{
$i = 0;
foreach($reg as $user)
{
$i++;
if(&quot;$name\n&quot; == $user)
{
print(&quot;<h1>found $name</h1>&quot;);
print(&quot;<br><h3>$reg[$i]</h3>&quot;);
$i++;
print(&quot;<br><h3>$reg[$i]</h3>&quot;);
}
}
}
?></td>
</tr>
</table>
</html>



outputs the following by viewing source:

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot;>
<html>
<head>
<title>Participant Search Results</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;Quanta Plus&quot;>
</head>
<body bgcolor=&quot;darkBlue&quot; text=&quot;white&quot; link=&quot;red&quot; alink=&quot;yellow&quot; vlink=&quot;lightGray&quot;>
<table width=&quot;100%&quot; cellspacing=0 border=0 cellpadding=0 align=&quot;center&quot; bgcolor=&quot;blue&quot;>
<tr align=&quot;center &quot; valign=&quot;center&quot; bgcolor=&quot;white&quot;>
<td><h1>found skottieb@hotmail.com</h1><br><h3>scott
</h3><br><h3>unpaid
</h3></td>
</tr>
</table>
</html>

The output look legitimate to me
What has gone wrong here and how should I go
about fixing it ??

Tanhx all

skottieb:)
 
Well, that was silly, I decalred white as a text AND bg color


skottieb:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top