Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 272 van 286

Marv

Lid

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Dan gebeurt er ook niks, zelfs geen error.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Is het niet gecommented? En mail() geeft gewoon true?
0
Marv

Lid

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Hij geeft helemaal niks aan.

toevoeging op 25 maart 2013, 14:41:30:
mail("****@outlook.com","test subject","est body");

zelfs als ik dit gebruik krijg ik geen foutmelding. error reporting staat gewoon aan
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Persoonlijk vind ik dit erg vreemd, want op mijn XAMPP installatie krijg ik gewoon mails. Wel via een SMTP van mijn isp.
0
Marv

Lid

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Hoe kan ik checken of een mail versuurd wordt? is er een error-handling voor de mail functie?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Ja, if-else... en als je meer wilt weten moet je phpMailer gebruiken.
Had ik geloof ik al verteld.
0
Marv

Lid

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Hmm.. PHPmailer werkt wel.
0
Marv

Lid

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Moest een 2 naar een 0 zetten wink
Bedankt Aarclay!
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb dit als error: Parse error: syntax error, unexpected [ in /home/mcsl/domains/mcserverlijsten.nl/public_html/alpha/includes/mc/MinecraftServerStatus.class.php on line 23

Dit is de line:

private $Info = [


het vervolgt zich met deze:

hostname   => ,
        gametype   => ,
        game_id    => ,
        version    => ,
        plugins    => ,
        map        => ,
        numplayers => ,
        maxplayers => ,
        hostport   => ,
        hostip     => 
    ];
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Dat is ook geen geldige array, wat in JS weer wel geldt.
Je werkt nu in PHP wink
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Dat is ook geen geldige array, wat in JS weer wel geldt.
Je werkt nu in PHP wink
het is een class van het internet, ben er mee bezig geweest en alles doorgenomen, snapte wel wat alles betekende, maar krijg deze error.

Moet ik het zo doen:

private $Info = array(
        hostname   => ,
        gametype   => ,
        game_id    => ,
        version    => ,
        plugins    => ,
        map        => ,
        numplayers => ,
        maxplayers => ,
        hostport   => ,
        hostip     => 
    );
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
probeer, en je ziet.
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
probeer, en je ziet.
Krijg ik dit confused
Fatal error: Uncaught exception Exception with message Failed to write on socket in /home/mcsl/domains/mcserverlijsten.nl/public_html/alpha/includes/mc/MinecraftServerStatus.class.php:137 Stack trace: #0 /home/mcsl/domains/mcserverlijsten.nl/public_html/alpha/includes/mc/MinecraftServerStatus.class.php(52): MinecraftServerStatus->Send(9) #1 /home/mcsl/domains/mcserverlijsten.nl/public_html/alpha/includes/header.php(7): MinecraftServerStatus->__construct(86.81.104.188:2...) #2 /home/mcsl/domains/mcserverlijsten.nl/public_html/alpha/index.php(1): include(/home/mcsl/doma...) #3 {main} thrown in /home/mcsl/domains/mcserverlijsten.nl/public_html/alpha/includes/mc/MinecraftServerStatus.class.php on line 137

dit is de line:

throw new Exception(Failed to write on socket, 2);
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Dan is er wat anders aan de hand, naast dat je array nu wel goed correct is.
Op welk moment van de code wordt dit ge-trowd?
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb zon gevoel dit stukje:

[COLOR= #0000BB]<?php[/COLOR]    [URL="http://www.php.net/private"]private[/URL] [COLOR= #007700]function[/COLOR] Send[COLOR= #007700]([/COLOR][COLOR= #0000BB]$Command[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$Addition[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]) {[/COLOR]
        [COLOR= #FF8000]// pack the command into a binary string[/COLOR]
        [COLOR= #0000BB]$Command[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/pack"]pack[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]c*[/COLOR][COLOR= #007700],[/COLOR] self[COLOR= #007700]::[/COLOR]B1[COLOR= #007700],[/COLOR] self[COLOR= #007700]::[/COLOR]B2[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$Command[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0x01[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0x02[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0x03[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0x04[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #0000BB]$Addition[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #FF8000]// send the binary string to the server[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Command[/COLOR][COLOR= #007700]) !== @[/COLOR][URL="http://www.php.net/fwrite"]fwrite[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]Socket[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$Command[/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Command[/COLOR][COLOR= #007700])))[/COLOR]
            throw [COLOR= #007700]new[/COLOR] Exception[COLOR= #007700]([/COLOR][COLOR= #DD0000]Failed to write on socket[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700]);[/COLOR]

        [COLOR= #FF8000]// listen what the server has to say now[/COLOR]
        [COLOR= #0000BB]$Data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/fread"]fread[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]Socket[COLOR= #007700],[/COLOR] [COLOR= #0000BB]2048[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Data[/COLOR] [COLOR= #007700]===[/COLOR] false[COLOR= #007700])[/COLOR]
            throw [COLOR= #007700]new[/COLOR] Exception[COLOR= #007700]([/COLOR][COLOR= #DD0000]Failed to read from socket[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]3[/COLOR][COLOR= #007700]);[/COLOR]

        [COLOR= #FF8000]// remove the first 5 unnecessary bytes (0x00, 0x01, 0x02, 0x03, 0x04) Status type and own ID token[/COLOR]
        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Data[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]5[/COLOR][COLOR= #007700]);
    }[/COLOR]
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