PHP interesse |
|
Hey iedereen ik krijg deze parrs error:
Parse error: parse error, unexpected $ in /home/httpd/vhosts/nightstreet.be/httpdocs/news.php on line 134
dit is mijn code:
<?
mysql_connect("localhost","news","ikkeenmama");
mysql_select_db("news");
?>
<html>
<head>
<title></title>
</head>
<body>
<?
switch($nem) {
case "1" :
Kijknews();
break;
case "2" :
Login();
break;
case "3" :
Admin();
break;
case "4" :
Reactiestoe();
break;
default :
News();
}
?>
<?
function News() {
$q = "SELECT * FROM news WHERE type='news'";
$r = mysql_query($q);
$rows = mysql_num_rows($r);
if($rows == "0") { ?>
<table width="373" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="373">Geen berichten </td>
</tr>
</table>
<?
} else {
$qq = "SELECT * FROM news WHERE type='reply'";
$rr = mysql_query($qq);
$rowsr = mysql_num_rows($rr);
while($n = mysql_fetch_object($r)) {?>
<table width="373" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="500"><? echo"$n->titel"; ?></td>
<td width="500">Gepost op:<? echo"$n->date"; ?></td>
</tr>
<tr>
<td><? echo "$n->bericht"; ?></td>
<td valign="top">Reageer</td>
</tr>
</table>
<?
}
}
}
?>
<?
function kijknews() {
$id = $_GET['id'];
$qm = "SELECT * FROM news WHERE id='$id'";
$rm = mysql_query($qm);
$rowsm = mysql_num_rows($rm);
if($rowsm == "0") {
echo "<br>
<table width='373' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='373'>Dit is een ongeldig id!</td>
</tr>
</table>";
}else{
echo "<table width='373' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='500'>$n->titel</td>
<td width='500'>$n->date</td>
</tr>
<tr>
<td>$n->bericht</td>
</tr>
</table>
<hr align='left' width='373' noshade>";
}
$sel = "SELECT * FROM news WHERE re_id='$id'";
$res = mysql_query($sel);
$nums = mysql_num_rows($res);
if($nums == "0") {
echo"
<table width='373' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td>Geen reacties ! </td>
</tr>
</table>";
}else{
while($r = mysql_fetch_object($res)) {
echo"
<table width='373' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td>$r->re_user</td>
</tr>
<tr>
<td>$r->re_titel</td>
</tr>
<tr>
<td>$r->re_bericht</td>
</tr>
</table>";
}
echo"
<hr align='left' width='373' noshade>
Reactie toevoegen ?<form name='form1' method='post' action='news.php?nem=4'>
<table width='373' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='70' valign='top'>Naam:</td>
<td width='303'><input name='user' type='text' id='user'></td>
</tr>
<tr>
<td valign='top'>Titel:</td>
<td><input name='titel' type='text' id='titel'></td>
</tr>
<tr>
<td valign='top'>Bericht:</td>
<td><textarea name='bericht' rows='12' id='bericht'></textarea></td>
</tr>
</table>
<p>
<input type='submit' name='Submit' value='Submit'>
</p>
</form>";
}
?>
</body>
</html>
<? ?> <html> <head> <title></title> </head> <body> <? switch($nem) { case "1" : Kijknews(); break; case "2" : Login(); break; case "3" : Admin(); break; case "4" : Reactiestoe(); break; default : News(); } ?> <? function News() { $q = "SELECT * FROM news WHERE type='news'"; if($rows == "0") { ?> <table width="373" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="373">Geen berichten </td> </tr> </table> <? } else { $qq = "SELECT * FROM news WHERE type='reply'"; <table width="373" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="500"> <? echo"$n->titel"; ?></td> <td width="500">Gepost op: <? echo"$n->date"; ?></td> </tr> <tr> <td> <? echo "$n->bericht"; ?></td> <td valign="top">Reageer</td> </tr> </table> <? } } } ?> <? function kijknews() { $id = $_GET['id']; $qm = "SELECT * FROM news WHERE id='$id'"; if($rowsm == "0") { <table width='373' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='373'>Dit is een ongeldig id!</td> </tr> </table>"; }else{ echo "<table width='373' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='500'>$n->titel</td> <td width='500'>$n->date</td> </tr> <tr> <td>$n->bericht</td> </tr> </table> <hr align='left' width='373' noshade>"; } $sel = "SELECT * FROM news WHERE re_id='$id'"; if($nums == "0") { <table width='373' border='0' cellspacing='0' cellpadding='0'> <tr> <td>Geen reacties ! </td> </tr> </table>"; }else{ <table width='373' border='0' cellspacing='0' cellpadding='0'> <tr> <td>$r->re_user</td> </tr> <tr> <td>$r->re_titel</td> </tr> <tr> <td>$r->re_bericht</td> </tr> </table>"; } <hr align='left' width='373' noshade> Reactie toevoegen ?<form name='form1' method='post' action='news.php?nem=4'> <table width='373' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='70' valign='top'>Naam:</td> <td width='303'><input name='user' type='text' id='user'></td> </tr> <tr> <td valign='top'>Titel:</td> <td><input name='titel' type='text' id='titel'></td> </tr> <tr> <td valign='top'>Bericht:</td> <td><textarea name='bericht' rows='12' id='bericht'></textarea></td> </tr> </table> <p> <input type='submit' name='Submit' value='Submit'> </p> </form>"; } ?> </body> </html>
Nog niet heel mijn script is af maar test het een keer als ik nieuwe funtie heb, maar kan mij iemand zeggen wat hier mis mee is ?:(
greeettzzzz^^
|