At A Loss With Simple parse error in my code ... another set of eyes needed

Discussion in 'PHP' started by JennBear, Oct 26, 2011.

Thread Status:
Not open for further replies.
  1. #1
    I am very new to PHP, and have been dabbling in some code.

    I am receiving this error when run:
    [h=1]Fatal error:  Call to a member function controllers() on a non-object in /home/a1912849/public_html/index.php on line 10[/h]
    Code (markup):
    Can anyone help me isolate the problem. I am unable to find anything obviously wrong.

    Here is my simple code ...

    <html>
    <head>
    <title>CZWG Virtual Notams</title>
    </head>
    <body>
    <H1>CZWG virtual Notam<h1>
    <?
    require_once("VatsimPHPgenerator.php");
    $VatsimPHP=newVatsimPHP;
    $clientlist=$VatsimPHP->controllers();
    $i=0;
    if ($clientlist) {
    foreach ($clientlist as $client) {
        if (in_array($client['0'],array('CYWG_GND','CYWG_DEL','CYWG_APP','CYWG_TWR','CYWG_DEP','CZWG_CTR','ZWG_BR_CTR','ZWG_FL_CTR','ZWG_VC_CTR','ZWG_NL_CTR','CYQT_TWR','CYQT_GND','CYQT_APP','CYQR_GND','CYQR_TWR','CYQR_APP','CYXE_GND','CYXE_TWR','CYXE_APP'))) {
            $i++;
            echo('<b>'.client[0].'<br>'.$client[2].'</b><br>');
        }
    }
    }
    if ($i==0) {echo ('<b>No controllers currently online.</b>');}
    ?>
    </body>
    </html>
    Code (markup):
    Thanks in advance!!!
    JEnn
     
    Last edited: Oct 26, 2011
    JennBear, Oct 26, 2011 IP
  2. JennBear

    JennBear Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Fixed it ...
    echo('<b>'.[color=blue]$[/color]client[0].'<br>'.$client[2].'</b><br>');
    Code (markup):
     
    JennBear, Oct 26, 2011 IP
Thread Status:
Not open for further replies.