why doesn't this flush work?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

why doesn't this flush work?

Post by GK »

i try to setup a flush in my script but it doesn't work

whats wrong here?

Code: Select all

if (!$action) 
{
include "functie.php";
?> <style type="text/css"> 
<!-- 
td.test { 
  color: black; 
  background: cyan; 
} 
td.test2 { 
  color: white; 
  background: black; 
} 
--> 
</style> <br><? include "menu.php"; ?><br><table width="98%" border="0" cellspacing="1" cellpadding="0" align="center"> 
<tr bgcolor="#000000"> <td class="t2"> <DIV ALIGN="CENTER"><b><A HREF="index.php?sort=id"><FONT COLOR="#FFFFFF">id</FONT></A></b></DIV></td><td class="t2"> 
<DIV ALIGN="CENTER"><b><A HREF="index.php?sort=name"><FONT COLOR="#FFFFFF">name</FONT></A></b></DIV></td><td class="t2"> 
<DIV ALIGN="CENTER"><b><A HREF="index.php?sort=status"><FONT COLOR="#FFFFFF">status</FONT></A></b></DIV></td><td class="t2"> 
<DIV ALIGN="CENTER"><b><A HREF="index.php?sort=added"><FONT COLOR="#FFFFFF">added</FONT></A></b></DIV></td><td class="t2"> 
<DIV ALIGN="CENTER"><b><A HREF="index.php?sort=category"><FONT COLOR="#FFFFFF">category</FONT></A></b></DIV></td><td class="t2"> 
<DIV ALIGN="CENTER"><FONT COLOR="#FFFFFF"><b>Options</b></FONT></DIV></td></tr> 
<?
if ($sort =="")
{
$sort = "linkdb.id";
}
$query = mysql_query ("SELECT linkdb.id, linkdb.category, linkdb.name, linkdb.url, linkdb.added, linkdb.status, linkcat.category2 FROM linkdb LEFT JOIN linkcat ON linkdb.category = linkcat.id ORDER BY $sort");  
while ($rows=mysql_fetch_assoc($query)){
	flush();
  extract($rows);
$file = $rows[url];
?> <tr onmouseover="this.className='test2'" 
onmouseout="this.className='test'"> <td bgcolor="#000000" class="t5"> <div align="center"> 
<FONT COLOR="#FFFFFF"><? echo $rows[id]; ?> <?
if ($rows[status] =="1")
{
$status1 = ('Actief');
} else {
$status1 = ('Niet actief');
}
?></FONT></div></td><td> <div align="left"> <A HREF="<? echo $rows[url]; ?>"><? echo $rows[name]; ?></A> 

</div></td><td> <div align="left"> <? echo $status1; ?> - <? 
preg_match("/^(http:\/\/)?([^\/]+)/i",
"$file", $matches);
$host = $matches[2];
// get last two segments of host name
preg_match("/[^\.\/]+\.[^\.\/]+$/",$host,$matches);
$fp = fsockopen ("$matches[0]", 80, $errno, $errstr, 30);  
if (!$fp) {  
    echo "$errstr ($errno)<br>\n";  
} else {  
    fputs ($fp, "GET / HTTP/1.0\r\nHost:$matches[0]\r\n\r\n");  
        $string =  fgets ($fp,128);  
    fclose ($fp);  
}  
$text = substr($string,9,3);  

switch ($text)  
{  
case "200":  
    echo "online";  
    break;  
case "204":  
    echo "no content";  
    break;  
case "301":  
    echo "permanently moved";  
    break;  
case "302":  
    echo "401 Unauthorized";  
    break;  
case "402":  
    echo "payment required";  
    break;  
case "403":  
    echo "acces forbidden";  
    break;  
case "404":  
    echo "page not found";  
    break;  
}  ?> </div></td><td> <div align="left"> 
<? echo $rows[added]; ?> </div></td><td> <div align="left"> <? echo $rows[category2]; ?> 
</div></td><td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
<tr> <td width="36%"> <div align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="index.php?id=<? echo $rows[id]; ?>&action=edit&category2=<? echo $rows[category2]; ?>" target="_self">Edit</a></font></b></div></td><td width="33%" class="t3"> 
<div align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="index.php?id=<? echo $rows[id]; ?>&action=delete" target="_self">Delete</a></font></b></div></td></table></td></tr> 
<?

}
}
		
//Weergeven
	
	?> </table><? print $show; ?> 
</body>
	</html>
Post Reply