Ik kijg een lastige error en ik weer niet waar de fout zit:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/shahiem/domains/habboregio.nl/public_html/admin_shop.php on line 35
Code:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/shahiem/domains/habboregio.nl/public_html/admin_shop.php on line 35
Code:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]inc/header.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]is_auth[COLOR= #007700]([/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]add[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<h1>Categorie toevoegen</h1>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]beschrijving[/COLOR][COLOR= #007700]]) ||[/COLOR]
[URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]min_rang_for_new_topic[/COLOR][COLOR= #007700]]))
{[/COLOR]
[COLOR= #0000BB]$arrFout[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Je hebt niet alles ingevuld![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$cat[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT 1 FROM shop_categorie WHERE naam = "[/COLOR] [COLOR= #007700].[/COLOR]
[URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$arrFout[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Deze categorie bestaat al[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$arrFout[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="rederror">[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ArrFout[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$val[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$val[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$arrFout[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO shop_categorie (naam, beschrijving, plaatje)
VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR]
[COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]beschrijving[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR]
[COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]plaatje[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #0000BB]$cat_id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT id FROM shop_categorie WHERE
naam = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" AND beschrijving = "[/COLOR] [COLOR= #007700].[/COLOR]
[URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]beschrijving[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" AND plaatje = "[/COLOR] [COLOR= #007700].[/COLOR]
[URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]plaatje[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]") . ""), 0);
echo [/COLOR][COLOR= #007700]<[/COLOR]div [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"greenerror"[/COLOR][COLOR= #007700]>[/COLOR]Categorie is aangemaakt[COLOR= #007700].[/COLOR] U wordt binnen
enkele seconden doorgestuurd of klik [COLOR= #007700]<[/COLOR]a href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"index"[/COLOR][COLOR= #007700]>[/COLOR]hier[COLOR= #007700]<[/COLOR]/a[COLOR= #007700]>[/COLOR] als u niet wilt
wachten[COLOR= #007700]<[/COLOR]/div[COLOR= #007700]><[/COLOR]meta http[COLOR= #007700]-[/COLOR]equiv[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"refresh"[/COLOR] content[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"3; URL=index"[/COLOR][COLOR= #007700]>[/COLOR][COLOR= #DD0000];
}
}
?>
<form action="#" method="post">
<table>
<tr>
<td>
<strong>Categorienaam</strong>
</td>
<td>
<input type="text" naam="naam">
</td>
</tr>
<tr>
<td>
<strong>Beschrijving</strong>
</td>
<td>
<input type="text" naam="beschrijving">
</td>
</tr>
<tr>
<td>
<strong>Plaatje</strong>
</td>
<td>
<input type="text" naam="plaatje" value="0">
</td>
</tr>
<tr>
<td>
<input type="submit" naam="submit" value="Nieuwe categorie
opslaan">
</td>
<td>
</td>
</tr>
</tr>
</table>
</form>
<?php
}
elseif($_GET[[/COLOR]act[COLOR= #DD0000]] == [/COLOR]edit[COLOR= #DD0000])
{
if(ctype_digit($_GET[[/COLOR]id[COLOR= #DD0000]]))
{
$cat_query = mysql_query("SELECT * FROM shop_categorie WHERE id = " .
mysql_real_escape_string($_GET[id]) . "") or trigger_error(mysql_error());
if(mysql_num_rows($cat_query))
{
$cat = mysql_fetch_assoc($cat_query);
if($_SERVER[[/COLOR]REQUEST_METHOD[COLOR= #DD0000]] == [/COLOR]POST[COLOR= #DD0000])
{
$cat_exists = mysql_query("SELECT 1 FROM shop_categorie WHERE naam =
" . mysql_real_escape_string($_POST[naam]) . " AND naam != " .
mysql_real_escape_string($cat[naam]) . "") or trigger_error(mysql_error());
if(empty($_POST[[/COLOR]naam[COLOR= #DD0000]]) || empty($_POST[[/COLOR]beschrijving[COLOR= #DD0000]]) ||
!ctype_digit($_POST[[/COLOR]min_rang_for_access[COLOR= #DD0000]]) ||
!ctype_digit($_POST[[/COLOR]min_rang_for_new_topic[COLOR= #DD0000]]))
{
echo [/COLOR][COLOR= #007700]<[/COLOR]div [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"rederror"[/COLOR][COLOR= #007700]>[/COLOR]Je hebt niet alles ingevuld[COLOR= #007700]!<[/COLOR]/div[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
}
elseif(mysql_num_rows($cat_exists))
{
echo [/COLOR][COLOR= #007700]<[/COLOR]div [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"rederror"[/COLOR][COLOR= #007700]>[/COLOR]Deze categorie bestaat al[COLOR= #007700]<[/COLOR]/div[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
}
else
{
mysql_query("UPDATE shop_categorie SET naam = " .
mysql_real_escape_string($_POST[naam]) . ", beschrijving = " .
mysql_real_escape_string($_POST[beschrijving]) . ", min_rang_for_access = " .
mysql_real_escape_string($_POST[min_rang_for_access]) . ", min_rang_for_new_topic = " .
mysql_real_escape_string($_POST[min_rang_for_new_topic]) . " WHERE id = " .
mysql_real_escape_string($_GET[id]) . "") or trigger_error(mysql_error());
echo [/COLOR][COLOR= #007700]<[/COLOR]div [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"greenerror"[/COLOR][COLOR= #007700]>[/COLOR]Categorie is aangepast[COLOR= #007700].[/COLOR] U wordt
binnen enkele seconden doorgestuurd of klik [COLOR= #007700]<[/COLOR]a
href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"index.php?p=forum&act=showcat&c= . htmlentities($_GET[id]) . "[/COLOR][COLOR= #007700]>[/COLOR]hier[COLOR= #007700]<[/COLOR]/a[COLOR= #007700]>[/COLOR] als
u niet wilt wachten[COLOR= #007700]<[/COLOR]/div[COLOR= #007700]><[/COLOR]meta http[COLOR= #007700]-[/COLOR]equiv[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"refresh"[/COLOR] content[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"3;
URL=index.php?p=forum&act=showcat&c= . htmlentities($_GET[id]) . "[/COLOR][COLOR= #007700]>[/COLOR][COLOR= #DD0000];
}
}
echo [/COLOR][COLOR= #007700]<[/COLOR]h1[COLOR= #007700]>[/COLOR]Categorie [COLOR= #DD0000] . htmlentities($cat[[/COLOR]naam[COLOR= #DD0000]]) . [/COLOR] aanpassen[COLOR= #007700]<[/COLOR]/h1[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
?>
<form action="#" method="post">
<table>
<tr>
<td>
<strong>Naam</strong>
</td>
<td>
<input type="text" naam="naam" value="<?php echo
(isset($_POST[[/COLOR]naam[COLOR= #DD0000]]) ? htmlentities($_POST[[/COLOR]naam[COLOR= #DD0000]]) : htmlentities($cat[[/COLOR]naam[COLOR= #DD0000]])); ?>">
</td>
</tr>
<tr>
<td>
<strong>Beschrijving</strong>
</td>
<td>
<textarea naam="beschrijving" rows="5" cols="40"><?php echo
(isset($_POST[[/COLOR]beschrijving[COLOR= #DD0000]]) ? htmlentities($_POST[[/COLOR]beschrijving[COLOR= #DD0000]]) :
htmlentities($cat[[/COLOR]beschrijving[COLOR= #DD0000]])); ?></textarea>
</td>
</tr>
<tr>
<td>
<strong>Minimale rang voor toegang <sup>(1)</sup></strong>
</td>
<td>
<input type="text" naam="min_rang_for_access" value="<?php echo
(isset($_POST[[/COLOR]min_rang_for_access[COLOR= #DD0000]]) ? htmlentities($_POST[[/COLOR]min_rang_for_access[COLOR= #DD0000]]) :
htmlentities($cat[[/COLOR]min_rang_for_access[COLOR= #DD0000]])); ?>">
</td>
</tr>
<tr>
<td>
<strong>Minimale rang om een nieuw topic aan te maken <sup>(1)
& (2)</sup></strong>
</td>
<td>
<input type="text" naam="min_rang_for_new_topic" value="<?php
echo (isset($_POST[[/COLOR]min_rang_for_new_topic[COLOR= #DD0000]]) ?
htmlentities($_POST[[/COLOR]min_rang_for_new_topic[COLOR= #DD0000]]) :
htmlentities($cat[[/COLOR]min_rang_for_new_topic[COLOR= #DD0000]])); ?>">
</td>
</tr>
<tr>
<td>
<input type="submit" naam="submit" value="Aanpassingen opslaan">
<input type="button" naam="cancel" value="Annuleren"
onclick="javascript:history.go(-1);">
</td>
<td>
</td>
</tr>
<tr>
<td>
<sub>(1): De rangen zijn als volgt:<br>0 = Gasten<br>1 = Lid<br>2
= VIP<br>3 = Moderator<br>4 = Admin<br>(2): Moet hoger zijn dan 1</sub>
</td>
<td>
</td>
</tr>
</table>
</form>
<?php
}
else
{
echo [/COLOR]Deze categorie bestaat [COLOR= #007700]([/COLOR]nog[COLOR= #007700])[/COLOR] niet[COLOR= #DD0000];
}
}
else
{
$cat_query = mysql_query("SELECT * FROM shop_categorie ORDER BY naam ASC") or
trigger_error(mysql_error());
echo [/COLOR][COLOR= #007700]<[/COLOR]h1[COLOR= #007700]>[/COLOR]Categorie aanpassen[COLOR= #007700]<[/COLOR]/h1[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
if(mysql_num_rows($cat_query))
{
echo [/COLOR]Kies een categorie om aan te passen[COLOR= #007700].<[/COLOR]br[COLOR= #007700]><[/COLOR]br[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
echo [/COLOR][COLOR= #007700]<[/COLOR]table border[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"1"[/COLOR][COLOR= #007700]><[/COLOR]tr[COLOR= #007700]><[/COLOR]td width[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"35%"[/COLOR] align[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"center"[/COLOR][COLOR= #007700]>[/COLOR]Naam[COLOR= #007700]<[/COLOR]/td[COLOR= #007700]><[/COLOR]td
width[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"35%"[/COLOR] align[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"center"[/COLOR][COLOR= #007700]>[/COLOR]Beschrijving[COLOR= #007700]<[/COLOR]/td[COLOR= #007700]><[/COLOR]td width[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"15%"[/COLOR] align[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"center"[/COLOR][COLOR= #007700]>[/COLOR]Minimale rang voor
toegang [COLOR= #007700]<[/COLOR]sup[COLOR= #007700]>([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700])<[/COLOR]/sup[COLOR= #007700]><[/COLOR]/td[COLOR= #007700]><[/COLOR]td width[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"15%"[/COLOR] align[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"center"[/COLOR][COLOR= #007700]>[/COLOR]Minimale rang om een nieuw topic
aan te maken [COLOR= #007700]<[/COLOR]sup[COLOR= #007700]>([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]) &[/COLOR]amp[COLOR= #007700]; ([/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700])<[/COLOR]/sup[COLOR= #007700]><[/COLOR]/td[COLOR= #007700]><[/COLOR]/tr[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
while($cat = mysql_fetch_assoc($cat_query))
{
echo [/COLOR][COLOR= #007700]<[/COLOR]tr[COLOR= #007700]><[/COLOR]td align[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"center"[/COLOR][COLOR= #007700]><[/COLOR]a
href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"index.php?p=admin_forum&act=edit&id= . htmlentities($cat[id]) . "[/COLOR][COLOR= #007700]>[/COLOR][COLOR= #DD0000] .
htmlentities($cat[[/COLOR]naam[COLOR= #DD0000]]) . [/COLOR][COLOR= #007700]<[/COLOR]/a[COLOR= #007700]><[/COLOR]/td[COLOR= #007700]><[/COLOR]td[COLOR= #007700]>[/COLOR][COLOR= #DD0000] . htmlentities($cat[[/COLOR]beschrijving[COLOR= #DD0000]]) . [/COLOR][COLOR= #007700]<[/COLOR]/td[COLOR= #007700]><[/COLOR]td
align[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"center"[/COLOR][COLOR= #007700]>[/COLOR][COLOR= #DD0000] . htmlentities($cat[[/COLOR]min_rang_for_access[COLOR= #DD0000]]) . [/COLOR][COLOR= #007700]<[/COLOR]/td[COLOR= #007700]><[/COLOR]td align[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"center"[/COLOR][COLOR= #007700]>[/COLOR][COLOR= #DD0000] .
htmlentities($cat[[/COLOR]min_rang_for_new_topic[COLOR= #DD0000]]) . [/COLOR][COLOR= #007700]<[/COLOR]/td[COLOR= #007700]><[/COLOR]/tr[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
}
echo [/COLOR][COLOR= #007700]<[/COLOR]/table[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
echo [/COLOR][COLOR= #007700]<[/COLOR]sub[COLOR= #007700]>([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]):[/COLOR] De rangen zijn als volgt[COLOR= #007700]:<[/COLOR]br[COLOR= #007700]>[/COLOR][COLOR= #0000BB]0[/COLOR] [COLOR= #007700]=[/COLOR] Gasten[COLOR= #007700]<[/COLOR]br[COLOR= #007700]>[/COLOR][COLOR= #0000BB]1[/COLOR] [COLOR= #007700]=[/COLOR] Lid[COLOR= #007700]<[/COLOR]br[COLOR= #007700]>[/COLOR][COLOR= #0000BB]2[/COLOR] [COLOR= #007700]=[/COLOR]
VIP[COLOR= #007700]<[/COLOR]br[COLOR= #007700]>[/COLOR][COLOR= #0000BB]3[/COLOR] [COLOR= #007700]=[/COLOR] Moderator[COLOR= #007700]<[/COLOR]br[COLOR= #007700]>[/COLOR][COLOR= #0000BB]4[/COLOR] [COLOR= #007700]=[/COLOR] Admin[COLOR= #007700]<[/COLOR]br[COLOR= #007700]>([/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]):[/COLOR] Moet hoger zijn dan [COLOR= #0000BB]1[/COLOR][COLOR= #007700]<[/COLOR]/sub[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
}
else
{
echo [/COLOR]Er zijn nog geen categorie[COLOR= #007700]&[/COLOR]euml[COLOR= #007700];[/COLOR]n om aan te passen[COLOR= #DD0000];
}
}
}
elseif($_GET[[/COLOR]act[COLOR= #DD0000]] == [/COLOR]delete[COLOR= #DD0000])
{
if(ctype_digit($_GET[[/COLOR]id[COLOR= #DD0000]]))
{
$cat_query = mysql_query("SELECT * FROM shop_categorie WHERE id = " .
mysql_real_escape_string($_GET[id]) . "") or trigger_error(mysql_error());
if(mysql_num_rows($cat_query))
{
$cat = mysql_fetch_assoc($cat_query);
if($_SERVER[[/COLOR]REQUEST_METHOD[COLOR= #DD0000]] == [/COLOR]POST[COLOR= #DD0000])
{
if(isset($_POST[[/COLOR]submit[COLOR= #DD0000]]))
{
mysql_query("DELETE FROM shop_categorie WHERE id = " .
mysql_real_escape_string($_GET[id]) . "") or trigger_error(mysql_error());
mysql_query("DELETE FROM forum_posts WHERE cat_id = " .
mysql_real_escape_string($_GET[id]) . "") or trigger_error(mysql_error());
mysql_query("DELETE FROM forum_topics WHERE cat_id = " .
mysql_real_escape_string($_GET[id]) . "") or trigger_error(mysql_error());
echo [/COLOR][COLOR= #007700]<[/COLOR]div [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"greenerror"[/COLOR][COLOR= #007700]>[/COLOR]De categorie[COLOR= #007700],[/COLOR] topics en posts in de
categorie is verwijderd[COLOR= #007700]<[/COLOR]/div[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
}
}
echo [/COLOR][COLOR= #007700]<[/COLOR]h1[COLOR= #007700]>[/COLOR]Categorie [COLOR= #DD0000] . htmlentities($cat[[/COLOR]naam[COLOR= #DD0000]]) . [/COLOR] verwijderen[COLOR= #007700]<[/COLOR]/h1[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
?>
<form action="#" method="post">
Weet je zeker dat je de categorie [/COLOR][COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL]
htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]);[/COLOR] ?> wilt verwijderen?<br>
<h2>LET OP: Als je de categorie verwijderd zullen alle topics en
posts in die categorie ook verwijderd worden</h2>
<input type="submit" naam="submit" value="Categorie verwijderen">
<input type="button" naam="cancel" value="Annuleren">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er zijn nog geen categorieën om te verwijderen[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$cat_query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM shop_categorie ORDER BY naam ASC"[/COLOR][COLOR= #007700])[/COLOR] or
[URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<h1>Categorie verwijderen</h1>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat_query[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Kies een categorie om te verwijderen.<br><br>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<table border="1"><tr><td width="300px"
align="center">Naam</td></tr>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat_query[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td align="center"><a
href="index.php?p=admin_forum&act=delete&id=[/COLOR] [COLOR= #007700].[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]">[/COLOR] [COLOR= #007700].[/COLOR]
htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]</a></td></tr>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</table>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er zijn nog geen categorieën om te verwijderen[/COLOR][COLOR= #007700];
}
}[/COLOR]
?>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="rederror">Je bent niet bevoegd om deze pagina te bekijken</div>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]inc/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?>