Thijmgrijs schreef:Eerdere citaten tonen
Rik schreef:Even uit mijn hoofd (hoeft dus niet 100% correct te werken, het is een voorbeeld!):
[COLOR= #0000BB]<?php[/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]del[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]uploads/[/COLOR] [COLOR= #007700]+[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]file[/COLOR][COLOR= #007700]])
{[/COLOR]
[URL="http://www.php.net/unlink"]unlink[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]uploads/[/COLOR] [COLOR= #007700]+[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]file[/COLOR][COLOR= #007700]]);
}
}[/COLOR]
[COLOR= #0000BB]$files[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/glob"]glob[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]uploads/*.*[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/is_array"]is_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$files[/COLOR][COLOR= #007700])[/COLOR] and [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$files[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<table>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$files[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$file[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>
<td>[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/basename"]basename[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$file[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]</td>
<td> - <a href="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$file[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]">Download</a> / <a href="?act=del&file=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$file[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]">Verwijder</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]<p>Er zijn geen bestanden gevonden</p>[/COLOR][COLOR= #007700];
}[/COLOR]
?>
Zo moeilijk lijkt me dit toch niet, dit is basisphp.
Parse error: syntax error, unexpected { in /home/*****/domains/******/public_html/overzicht.php on line 5
Het is inderdaad basisphp.
Maar heb vandaag echt teveel gedaan, ik block mezelf een beetje

Moesten binnen 1 dag een volledig systeem maken en kijken hoever we kwamen, voor mn nieuwe opleiding. Ik ben al klaar ermee eigenlijk, maar dit zijn van die extra dingetjes die erbij kunnen.
Lezen is latig:
Quote:
(hoeft dus niet 100% correct te werken, het is een voorbeeld!)
Geeft dus weer aan dat je de code gewoon één op één hebt gekopieerd en geen moeite ervoor doet.
Aarclay schreef:Tel je haakjes eens....
En die + moet een punt zijn, het is PHP en geen JS

Sorry, ik zit met school met C# en Java die wel met de "+" werkt in plaats van de "."