Fatal error: Call to undefined function
Hej eksperter.Jeg sidder her med et lille problem som jeg ikke kan få løst:
Som ses i koden eksistere begge funktioner (p_indbakke og p_udbakke), alligevel kommer fejlen "Fatal error: Call to undefined function p_indbakke() in /home/hogwarts/public_html/post/no/new/postbesked_.php on line 34" (line 34 er "default: p_indbakke(); break;".
switch($_GET['wat'])
{
case 'indbakke': p_indbakke(); break;
case 'udbakke': p_udbakke(); break;
default: p_indbakke(); break;
}
function p_indbakke()
{
global $bruger;
print "
<table width=75% class='table' border='0' cellspacing='1'>
<tr>
<td class='h' width='30%' style='border:1px; font-size:14px; font-weight:bold;'></td>
<td class='h' width='70%' style='border:1px; font-size:14px; font-weight:bold;'>Fra</td>
<td class='h' width='110%' style='border:1px; font-size:14px; font-weight:bold;'>Emne</td>
<td class='h' width='150%' style='border:1px; font-size:14px; font-weight:bold;'>Dato</td>
</tr>
";
$hentpost=mysql_query("SELECT * FROM post WHERE til='{$bruger}' AND til_gemt='0' ORDER BY id DESC LIMIT 0,500");
while($post=mysql_fetch_array($hentpost))
{
$hentsender=mysql_query("SELECT * FROM brugere WHERE brugernavn='{$post['fra']}'");
$s_b=mysql_fetch_array($hentsender);
print "<tr><td>";
print "<a href='/post/no/new/postbesked.php?wat=confirm&id={$post['id']}'>Slet</a><br>
<a href='/post/no/new/postbesked.php?wat=gem&id={$post['id']}'>Gem besked</a>";
print "</td><td>";
if($post['laest'] == 0){
print "<strong><a href='/brugere/{$post['fra']}'><img src='{$s_b['billed']}' width='50px' height='50px'> {$post['fra']}</a>";
print "</td><td>";
print "<a href='/post/no/new/postbesked.php?wat=vis&id={$post['id']}'>{$post['emne']}</a>";
print "</td><td>";
print "{$post['dato']}";
print "</td></tr></strong>";
} else {
print "<a href='/brugere/{$post['fra']}'><img src='{$s_b['billed']}' width='50px' height='50px'> {$post['fra']}</a>";
print "</td><td>";
print "<a href='/post/no/new/postbesked.php?wat=vis&id={$post['id']}'>{$post['emne']}</a>";
print "</td><td>";
print "{$post['dato']}";
print "</td></tr>";
}
}
print "</table>";
}
function p_udbakke()
{
global $bruger;
print "
<table width=75% class='table' border='0' cellspacing='1'>
<tr>
<td class='h' width='30%' style='border:1px; font-size:14px; font-weight:bold;'></td>
<td class='h' width='70%' style='border:1px; font-size:14px; font-weight:bold;'>Til</td>
<td class='h' width='110%' style='border:1px; font-size:14px; font-weight:bold;'>Emne</td>
<td class='h' width='150%' style='border:1px; font-size:14px; font-weight:bold;'>Dato</td>
</tr>
";
$hentpost=mysql_query("SELECT * FROM post WHERE fra='{$bruger}' ORDER BY id DESC LIMIT 0,500");
$hentmodtager=mysql_query("SELECT * FROM brugere WHERE brugernavn='{$post['til']}'");
$m_b=mysql_fetch_array($hentmodtager);
while($post=mysql_fetch_array($hentpost))
{
print "<tr><td>";
if($post['laest'] == 0){
print "<a href='/post/no/new/postbesked.php?wat=u_confirm&id={$post['id']}'>Fortryd afsendelse</a><br>";
print "</td><td>";
print "<strong><a href='/brugere/{$post['til']}'><img src='{$m_b['billed']}' width='50px' height='50px'> {$post['til']}</a>";
print "</td><td>";
print "<a href='/post/no/new/postbesked.php?wat=u_vis&id={$post['id']}'>{$post['emne']}</a>";
print "</td><td>";
print "{$post['dato']}";
print "</td></tr></strong>";
} else {
print "<a href='/post/no/new/postbesked.php?wat=u_confirm&id={$post['id']}'>Slet</a><br>";
print "</td><td>";
print "<a href='/brugere/{$post['til']}'><img src='{$m_b['billed']}' width='50px' height='50px'> {$post['til']}</a>";
print "</td><td>";
print "<a href='/post/no/new/postbesked.php?wat=u_vis&id={$post['id']}'>{$post['emne']}</a>";
print "</td><td>";
print "{$post['dato']}";
print "</td></tr>";
}
print "</table>";
}
}
Nogen forklaring/idéer på hvorfor?
På forhånd tak!