Probleem met lay-out.
***********
*Links.php*
***********
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
echo "<table width=\"800\">";
sql_conn();
$query = "SELECT * FROM `links` ORDER BY link";
$result = mysql_query($query)or die(mysql_error());
while ($rij = mysql_fetch_array($result)){
echo"
<tr>
<td>
<a href=".$rij['url']." target=_blank class=style2>".$rij['link']."</a>
</td>
<td>
".link_exp($rij['url'])."
</td>
</tr>
";
}
echo "</table>";
?>
echo "<table width=\"800\">";
sql_conn();
$query = "SELECT * FROM `links` ORDER BY link";
$result = mysql_query($query)or die(mysql_error());
while ($rij = mysql_fetch_array($result)){
echo"
<tr>
<td>
<a href=".$rij['url']." target=_blank class=style2>".$rij['link']."</a>
</td>
<td>
".link_exp($rij['url'])."
</td>
</tr>
";
}
echo "</table>";
?>
***************
*Functions.php*
***************
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
function link_exp($link)
{
$link = str_replace ('http://', '', $link);
$link = str_replace ('www.', '', $link);
link_check($link);
};
function link_check($url)
{
if(fsockopen($url, 80, $errno, $errstr, 2) !== false)
{
echo"<span id=\"active\">•</span>";
}
else
{
echo"<span id=\"down\">•</span>";
}
};
?>
function link_exp($link)
{
$link = str_replace ('http://', '', $link);
$link = str_replace ('www.', '', $link);
link_check($link);
};
function link_check($url)
{
if(fsockopen($url, 80, $errno, $errstr, 2) !== false)
{
echo"<span id=\"active\">•</span>";
}
else
{
echo"<span id=\"down\">•</span>";
}
};
?>
en dan krijg ik in mijn bron hetvolgende:
<table width="800"><span id="active">•</span>
<tr>
<td>
<a href=http://www.google.be target=_blank class=style2>Google</a>
</td>
<td>
</td>
</tr>
<span id="active">•</span>
<tr>
<td>
<a href=http://www.phpfreakz.nl target=_blank class=style2>phpfreakz</a>
</td>
<td>
</td>
</tr>
</table>
De bolletjes (•) komen boven de links te staan in plaats van erlangs.
--> http://img184.imageshack.us/img184/2973/79693752ud9.jpg
Alvast bedankt, dietger.
Zoek hier ook eens hoe je correct mysql gebruikt, dus geen backtricks.