Hoi,
Omdat ik dus geen ervaring met file_get_contents heb.. Vraag ik het maar hier..
Ik heb nu dit dus:
Hoe zorg ik ervoor dat als de website niet bereikbaar is, dat hij dan notonline.php include, en als hij wel bereikbaar is goonline.php included?
#Milan
Omdat ik dus geen ervaring met file_get_contents heb.. Vraag ik het maar hier..
Ik heb nu dit dus:
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/**
* @author Milan Drossaerts
* @for Bob Maas
* @page check.php
* @copyright 2009
*/[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR][COLOR= #FF8000]//Ik weet niet waar je database connectie staat, maar ik ga uit van config.php[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT tabbellen FROM kolom"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR][COLOR= #FF8000]//De query om te selecteren[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])[/COLOR][COLOR= #FF8000]//Net zovaak herhalen als er in de database staat[/COLOR]
[COLOR= #007700]{[/COLOR][COLOR= #FF8000]//Loop beginnen[/COLOR]
[COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR][COLOR= #FF8000]//Zorgen dat gegevens kunnen worden weergeven[/COLOR]
[COLOR= #0000BB]$ophalen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR][COLOR= #FF8000]//Kijken of de opgegeven website content bevat[/COLOR]
[COLOR= #007700]}[/COLOR][COLOR= #FF8000]//Loop beeindigen[/COLOR]
?> Hoe zorg ik ervoor dat als de website niet bereikbaar is, dat hij dan notonline.php include, en als hij wel bereikbaar is goonline.php included?
#Milan