.txt bestand openen en uitlezen

Gestart doorTmeiland4 reacties57 weergaven

5 berichten · pagina 1 van 1

Tmeiland

Lid · Topicstarter

Berichten
450
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik wil graag dit op mijn website plaatsen

$fh = fopen("licentie.txt", "r");

if($fh==false)
die("Licentie.txt is niet gevonden.");
?>

nu wordt licentie.txt alleen geopend en als er geen licentie.txt op men website staat
staat er licentie niet gevonden

maar ik wil graag dat ook nog wat extra heeft, zoals
als er 5434 niet instaat in het licentie.txt dat die dan geeft licentie ongeldig.

dus zo iets

$fh = fopen("licentie.txt", "r");

if($fh==false)
die("Licentie.txt is niet gevonden.");

$fh = fopen("jouwlicentiecode");

if($read==false)
die("Licentie code is niet geldig");
?>

en dat nu het .txt mapje daar moet in:

jouwlicentiecode

en als er niks in staat dat die aan geeft u heeft geen licentie ingevoerd.

Hopelijk snappen jullie me.
0
Berichten
513
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$fh = fopen("licentie.txt", "r");

if($fh==false){
die("Licentie.txt is niet gevonden.");
}
else{
echoBestand is gevonden;
}
?>

zoiets?
ps die laatste stuk code snap ik niet wink
0
Berichten
5.795
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
t kan veel simpeler

[COLOR= #0000BB]<?php
$c[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"licentie.txt"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$c[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"kon licentie.txt niet vinden"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$c[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]5434[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"licentie.txt klopt niet!"[/COLOR][COLOR= #007700]);
}[/COLOR]
?>
0
Berichten
513
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Daiman schreef:
t kan veel simpeler

[COLOR= #0000BB]<?php
$c[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"licentie.txt"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$c[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"kon licentie.txt niet vinden"[/COLOR][COLOR= #007700]);
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$c[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]5434[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"licentie.txt klopt niet!"[/COLOR][COLOR= #007700]);
}[/COLOR]
?>
had ook gekunt xD
0
Berichten
6.722
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Radiooctaaf; Dat van Daiman is iets heel anders dan dat van jou. Jij hebt alleen overgetypt wat Tmeiland al had. emo Daiman heeft de oplossing gegeven.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren