Avatar billede flol Nybegynder
10. december 2006 - 18:42 Der er 2 kommentarer og
1 løsning

Blank side ? som ikke skulle være blank :P

Hey denne kode rasulter en blank side, siden skulle helst ikke være blank, så der må være en fejl et sted i koden, men har ikke kunne finde nogle. kan i ?

----------------------------------kode---------------------------

<?
session_start();
$bruger = $_SESSION['Brugernavn'];
include('connect.php');

$query = mysql_query("SELECT * FROM Forum-emner WHERE kategori = 'Rollespil' or id = '$_GET[id]'") or die(mysql_error());
while ($row = mysql_fetch_assoc($query)) {
    $titel = $row['titel'];
    $besked = $row['besked'];
    $time = $row['time'];
    $brugernavn = $row['brugernavn'];
   
    $submit = $_POST['submit'];
    $overskrift = $_POST['overskrift'];
    $kommentar = $_POST['kommentar'];
   
    $smile = "$besked";
   
    $smile1 = str_replace(':D', '<img src="Smilies/icon_biggrin.gif">', $smile);
    $smile2 = str_replace('8D', '<img src="smilies/icon_cool.gif">', $smile1);
    $smile3 = str_replace(':\'(', '<img src="smilies/icon_cry.gif">', $smile2);
    $smile4 = str_replace('8)', '<img src="smilies/icon_eek.gif">', $smile3);
    $smile5 = str_replace('x;(', '<img src="smilies/icon_evil.gif">', $smile4);
    $smile6 = str_replace(';D', '<img src="smilies/icon_lol.gif">', $smile5);
    $smile7 = str_replace('D:', '<img src="smilies/icon_mad.gif">', $smile6);
    $smile8 = str_replace(':P', '<img src="smilies/icon_razz.gif">', $smile7);
    $smile9 = str_replace(':I', '<img src="smilies/icon_redface.gif">', $smile8);
    $smile10 = str_replace(':(', '<img src="smilies/icon_sad.gif">', $smile9);
    $smile11 = str_replace(':^)', '<img src="smilies/icon_smile.gif">', $smile10);
    $smile12 = str_replace(':O', '<img src="smilies/icon_surprised.gif">', $smile11);
    $smile13 = str_replace('x;)', '<img src="smilies/icon_twisted.gif">', $smile12);
    $smile14 = str_replace('*>*', '<img src="smilies/icon_arrow.gif">', $smile13);
    $smile15 = str_replace(':S', '<img src="smilies/icon_confused.gif">', $smile14);
    $smile16 = str_replace('*!*', '<img src="smilies/icon_exclaim.gif">', $smile15);
    $smile17 = str_replace('(I)', '<img src="smilies/icon_idea.gif">', $smile16);
    $smile18 = str_replace('*?*', '<img src="smilies/icon_question.gif">', $smile17);
    $smile19 = str_replace('::)', '<img src="smilies/icon_rolleyes.gif">', $smile18);
    $smile20 = str_replace(';)', '<img src="smilies/icon_wink.gif">', $smile19);
?>
<table border="1" width="971" height="111">
    <tr>
        <td width="961" height="47">
            <p align="center"><? echo "$titel"; ?></p>
        </td>
    </tr>
    <tr>
        <td width="961"><? echo "$smile20"; ?></td>
    </tr>
    <tr>
        <td width="961"><? echo "$time"; ?> </td><td>| <? echo "$brugernavn"; ?></td>
    </tr>
</table>
<hr>
<?
    if ($_SESSION['admin'] == 'admin') {
?>
<html>
<head>
<title>Opret nyt emne:</title>
<meta name="generator" content="Namo WebEditor(Trial)">
</head>

<form action="emne-info.php?id<? echo $_GET['id']; ?>" method="post">
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p align="center">Skriv kommentar:</p>
<p>&nbsp;</p>

<table width="287" align="center" cellpadding="0" cellspacing="0" bordercolordark="black" bordercolorlight="black" height="260">
    <tr>
        <td width="87" height="108" rowspan="5" valign="top">
            <p>Smilies:
           
            <script language='JavaScript'>
function addSmiley(theSmiley)
{
    document.getElementById("msgArea").value += theSmiley;
}
            </script>
           
</p>
            <p>&nbsp;</p>
        </td>
        <td width="50" height="16"><img src="Smilies/icon_biggrin.gif" width="15" height="15" border="0" onClick="addSmiley(':D')"></td>
        <td width="50" height="16"><img src="Smilies/icon_cool.gif" width="15" height="15" border="0" onClick="addSmiley('8D')"></td>
        <td width="50" height="16"><img src="Smilies/icon_cry.gif" width="15" height="15" border="0" onClick="addSmiley(':'(')"></td>
        <td width="50" height="16"><img src="Smilies/icon_eek.gif" width="15" height="15" border="0" onClick="addSmiley('8)')"></td>
    </tr>
    <tr>
        <td width="50" height="4"><img src="Smilies/icon_evil.gif" width="15" height="15" border="0" onClick="addSmiley('x;(')"></td>
        <td width="50" height="4"><img src="Smilies/icon_lol.gif" width="15" height="15" border="0" onClick="addSmiley(';D')"></td>
        <td width="50" height="4"><img src="Smilies/icon_mad.gif" width="15" height="15" border="0" onClick="addSmiley('D:')"></td>
        <td width="50" height="4"><img src="Smilies/icon_razz.gif" width="15" height="15" border="0" onClick="addSmiley(':P')"></td>
    </tr>
    <tr>
        <td width="50" height="7"><img src="Smilies/icon_redface.gif" width="15" height="15" border="0" onClick="addSmiley(':I')"></td>
        <td width="50" height="7"><img src="Smilies/icon_sad.gif" width="15" height="15" border="0" onClick="addSmiley(':(')"></td>
        <td width="50" height="7"><img src="Smilies/icon_smile.gif" width="15" height="15" border="0" onClick="addSmiley(':^)')"></td>
        <td width="50" height="7"><img src="Smilies/icon_surprised.gif" width="15" height="15" border="0" onClick="addSmiley(':O')"></td>
    </tr>
    <tr>
        <td width="50" height="7"><img src="Smilies/icon_twisted.gif" width="15" height="15" border="0" onClick="addSmiley('x;)')"></td>
        <td width="50" height="7"><img src="Smilies/icon_arrow.gif" width="15" height="15" border="0" onClick="addSmiley('*>*')"></td>
        <td width="50" height="7"><img src="Smilies/icon_confused.gif" width="15" height="15" border="0" onClick="addSmiley(':S')"></td>
        <td width="50" height="7"><img src="Smilies/icon_exclaim.gif" width="15" height="15" border="0" onClick="addSmiley('*!*')"></td>
    </tr>
    <tr>
        <td width="50" height="13"><img src="Smilies/icon_idea.gif" width="15" height="15" border="0" onClick="addSmiley('(I)')"></td>
        <td width="50" height="13"><img src="Smilies/icon_question.gif" width="15" height="15" border="0" onClick="addSmiley('*?*')"></td>
        <td width="50" height="13"><img src="Smilies/icon_rolleyes.gif" width="15" height="15" border="0" onClick="addSmiley('::)')"></td>
        <td width="50" height="13"><img src="Smilies/icon_wink.gif" width="15" height="15" border="0" onClick="addSmiley(';)')"></td>
    </tr>
    <tr>
        <td width="87">&nbsp;
        </td>
        <td width="200" colspan="4">&nbsp;</td>
    </tr>
    <tr>
        <td width="87">
            <p align="left">Overskrift: </p>
        </td>
        <td width="200" colspan="4"><input type="text" name="overskrift"></td>
    </tr>
    <tr>
        <td width="87" valign="top">
            <p align="left">Besked: </p>
        </td>
        <td width="200" colspan="4"><textarea id="msgArea" name="kommentar" rows="5" cols="25"></textarea></td>
    </tr>
    <tr>
        <td width="87">&nbsp;</td>
        <td width="200" colspan="4"><input type="submit" name="submit" value="Send"></td>
    </tr>
</table>
<p>&nbsp;</p>
</body>
</form>
</html>
<?
    if(isset($submit)) {
        mysql_query("INSERT INTO form-kommentar VALUES('', '$emneid', '$bruger', '$kommentar', '$overskrift', NOW())") or die(mysql_error());
    }
}
if ($_SESSION['loget_in'] == 1) {
?>
<html>
<head>
<title>Opret nyt emne:</title>
<meta name="generator" content="Namo WebEditor(Trial)">
</head>

<form action="emne-info.php?id<? echo $_GET['id']; ?>" method="post">
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p align="center">Skriv kommentar:</p>
<p>&nbsp;</p>

<table width="287" align="center" cellpadding="0" cellspacing="0" bordercolordark="black" bordercolorlight="black" height="260">
    <tr>
        <td width="87" height="108" rowspan="5" valign="top">
            <p>Smilies:
           
            <script language='JavaScript'>
function addSmiley(theSmiley)
{
    document.getElementById("msgArea").value += theSmiley;
}
            </script>
           
</p>
            <p>&nbsp;</p>
        </td>
        <td width="50" height="16"><img src="Smilies/icon_biggrin.gif" width="15" height="15" border="0" onClick="addSmiley(':D')"></td>
        <td width="50" height="16"><img src="Smilies/icon_cool.gif" width="15" height="15" border="0" onClick="addSmiley('8D')"></td>
        <td width="50" height="16"><img src="Smilies/icon_cry.gif" width="15" height="15" border="0" onClick="addSmiley(':'(')"></td>
        <td width="50" height="16"><img src="Smilies/icon_eek.gif" width="15" height="15" border="0" onClick="addSmiley('8)')"></td>
    </tr>
    <tr>
        <td width="50" height="4"><img src="Smilies/icon_evil.gif" width="15" height="15" border="0" onClick="addSmiley('x;(')"></td>
        <td width="50" height="4"><img src="Smilies/icon_lol.gif" width="15" height="15" border="0" onClick="addSmiley(';D')"></td>
        <td width="50" height="4"><img src="Smilies/icon_mad.gif" width="15" height="15" border="0" onClick="addSmiley('D:')"></td>
        <td width="50" height="4"><img src="Smilies/icon_razz.gif" width="15" height="15" border="0" onClick="addSmiley(':P')"></td>
    </tr>
    <tr>
        <td width="50" height="7"><img src="Smilies/icon_redface.gif" width="15" height="15" border="0" onClick="addSmiley(':I')"></td>
        <td width="50" height="7"><img src="Smilies/icon_sad.gif" width="15" height="15" border="0" onClick="addSmiley(':(')"></td>
        <td width="50" height="7"><img src="Smilies/icon_smile.gif" width="15" height="15" border="0" onClick="addSmiley(':^)')"></td>
        <td width="50" height="7"><img src="Smilies/icon_surprised.gif" width="15" height="15" border="0" onClick="addSmiley(':O')"></td>
    </tr>
    <tr>
        <td width="50" height="7"><img src="Smilies/icon_twisted.gif" width="15" height="15" border="0" onClick="addSmiley('x;)')"></td>
        <td width="50" height="7"><img src="Smilies/icon_arrow.gif" width="15" height="15" border="0" onClick="addSmiley('*>*')"></td>
        <td width="50" height="7"><img src="Smilies/icon_confused.gif" width="15" height="15" border="0" onClick="addSmiley(':S')"></td>
        <td width="50" height="7"><img src="Smilies/icon_exclaim.gif" width="15" height="15" border="0" onClick="addSmiley('*!*')"></td>
    </tr>
    <tr>
        <td width="50" height="13"><img src="Smilies/icon_idea.gif" width="15" height="15" border="0" onClick="addSmiley('(I)')"></td>
        <td width="50" height="13"><img src="Smilies/icon_question.gif" width="15" height="15" border="0" onClick="addSmiley('*?*')"></td>
        <td width="50" height="13"><img src="Smilies/icon_rolleyes.gif" width="15" height="15" border="0" onClick="addSmiley('::)')"></td>
        <td width="50" height="13"><img src="Smilies/icon_wink.gif" width="15" height="15" border="0" onClick="addSmiley(';)')"></td>
    </tr>
    <tr>
        <td width="87">&nbsp;
        </td>
        <td width="200" colspan="4">&nbsp;</td>
    </tr>
    <tr>
        <td width="87">
            <p align="left">Overskrift: </p>
        </td>
        <td width="200" colspan="4"><input type="text" name="overskrift"></td>
    </tr>
    <tr>
        <td width="87" valign="top">
            <p align="left">Besked: </p>
        </td>
        <td width="200" colspan="4"><textarea id="msgArea" name="kommentar" rows="5" cols="25"></textarea></td>
    </tr>
    <tr>
        <td width="87">&nbsp;</td>
        <td width="200" colspan="4"><input type="submit" name="submit" value="Send"></td>
    </tr>
</table>
<p>&nbsp;</p>
</body>
</form>
</html>
<?
if(isset($submit)) {
    mysql_query("INSERT INTO form-kommentar VALUES('', '$emneid', '$bruger', '$kommentar', '$overskrift', NOW())") or die(mysql_error());
}
if ($_SESSION['over_normal'] == 'over_normal') {
?>
<html>
<head>
<title>Opret nyt emne:</title>
<meta name="generator" content="Namo WebEditor(Trial)">
</head>

<form action="emne-info.php?id<? echo $_GET['id']; ?>" method="post">
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p align="center">Skriv kommentar:</p>
<p>&nbsp;</p>

<table width="287" align="center" cellpadding="0" cellspacing="0" bordercolordark="black" bordercolorlight="black" height="260">
    <tr>
        <td width="87" height="108" rowspan="5" valign="top">
            <p>Smilies:
           
            <script language='JavaScript'>
function addSmiley(theSmiley)
{
    document.getElementById("msgArea").value += theSmiley;
}
            </script>
           
</p>
            <p>&nbsp;</p>
        </td>
        <td width="50" height="16"><img src="Smilies/icon_biggrin.gif" width="15" height="15" border="0" onClick="addSmiley(':D')"></td>
        <td width="50" height="16"><img src="Smilies/icon_cool.gif" width="15" height="15" border="0" onClick="addSmiley('8D')"></td>
        <td width="50" height="16"><img src="Smilies/icon_cry.gif" width="15" height="15" border="0" onClick="addSmiley(':'(')"></td>
        <td width="50" height="16"><img src="Smilies/icon_eek.gif" width="15" height="15" border="0" onClick="addSmiley('8)')"></td>
    </tr>
    <tr>
        <td width="50" height="4"><img src="Smilies/icon_evil.gif" width="15" height="15" border="0" onClick="addSmiley('x;(')"></td>
        <td width="50" height="4"><img src="Smilies/icon_lol.gif" width="15" height="15" border="0" onClick="addSmiley(';D')"></td>
        <td width="50" height="4"><img src="Smilies/icon_mad.gif" width="15" height="15" border="0" onClick="addSmiley('D:')"></td>
        <td width="50" height="4"><img src="Smilies/icon_razz.gif" width="15" height="15" border="0" onClick="addSmiley(':P')"></td>
    </tr>
    <tr>
        <td width="50" height="7"><img src="Smilies/icon_redface.gif" width="15" height="15" border="0" onClick="addSmiley(':I')"></td>
        <td width="50" height="7"><img src="Smilies/icon_sad.gif" width="15" height="15" border="0" onClick="addSmiley(':(')"></td>
        <td width="50" height="7"><img src="Smilies/icon_smile.gif" width="15" height="15" border="0" onClick="addSmiley(':^)')"></td>
        <td width="50" height="7"><img src="Smilies/icon_surprised.gif" width="15" height="15" border="0" onClick="addSmiley(':O')"></td>
    </tr>
    <tr>
        <td width="50" height="7"><img src="Smilies/icon_twisted.gif" width="15" height="15" border="0" onClick="addSmiley('x;)')"></td>
        <td width="50" height="7"><img src="Smilies/icon_arrow.gif" width="15" height="15" border="0" onClick="addSmiley('*>*')"></td>
        <td width="50" height="7"><img src="Smilies/icon_confused.gif" width="15" height="15" border="0" onClick="addSmiley(':S')"></td>
        <td width="50" height="7"><img src="Smilies/icon_exclaim.gif" width="15" height="15" border="0" onClick="addSmiley('*!*')"></td>
    </tr>
    <tr>
        <td width="50" height="13"><img src="Smilies/icon_idea.gif" width="15" height="15" border="0" onClick="addSmiley('(I)')"></td>
        <td width="50" height="13"><img src="Smilies/icon_question.gif" width="15" height="15" border="0" onClick="addSmiley('*?*')"></td>
        <td width="50" height="13"><img src="Smilies/icon_rolleyes.gif" width="15" height="15" border="0" onClick="addSmiley('::)')"></td>
        <td width="50" height="13"><img src="Smilies/icon_wink.gif" width="15" height="15" border="0" onClick="addSmiley(';)')"></td>
    </tr>
    <tr>
        <td width="87">&nbsp;
        </td>
        <td width="200" colspan="4">&nbsp;</td>
    </tr>
    <tr>
        <td width="87">
            <p align="left">Overskrift: </p>
        </td>
        <td width="200" colspan="4"><input type="text" name="overskrift"></td>
    </tr>
    <tr>
        <td width="87" valign="top">
            <p align="left">Besked: </p>
        </td>
        <td width="200" colspan="4"><textarea id="msgArea" name="kommentar" rows="5" cols="25"></textarea></td>
    </tr>
    <tr>
        <td width="87">&nbsp;</td>
        <td width="200" colspan="4"><input type="submit" name="submit" value="Send"></td>
    </tr>
</table>
<p>&nbsp;</p>
</body>
</form>
</html>
<?

if(isset($submit)) {
    mysql_query("INSERT INTO form-kommentar VALUES('', '$emneid', '$bruger', '$kommentar', '$overskrift', NOW())") or die(mysql_error());
    }
}
include('kommentar.php');
?>
Avatar billede jakobdo Ekspert
10. december 2006 - 19:45 #1
Som jeg ser det, så mangler du en }
Du starter den her: while ($row = mysql_fetch_assoc($query)) {
Men lukker den aldrig.
Avatar billede flol Nybegynder
11. december 2006 - 10:04 #2
ja det opdagede jeg også :P
men det var ikke det der skyldte fejlen.. :O
Avatar billede flol Nybegynder
16. januar 2007 - 13:12 #3
Lukker..!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester