Function seen as "Unexpected T_STRING"

Status
Not open for further replies.

mindos4

New Member
Messages
22
Reaction score
0
Points
0
Hi, my webpage (mindos4.com.exofire.net/msl/bin/mdm.php) keeps getting an error. It seems like the php interpreter stops reading the file after line 140, and anything after is an error. It says error on line 142 because line 141 is blank. There is no actual syntax error. What's wrong?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Posting the contents of mdm.php would help.
 

mindos4

New Member
Messages
22
Reaction score
0
Points
0
Here it is:

Code:
<?
 $cmd = $_GET['cmd'];
 $cmd = strtolower($cmd);
 
 if ($_GET['ref'] == "logout") {
  LOGN();
 } elseif (isset($_GET['LOGN'])) {
  CHKUSR();
 } elseif ($cmd == "cpanel") {
  cpanel();
 } elseif ($cmd == "ls") {
  lsN();
 } elseif ($cmd == "logout" || $cmd == "logoff" || $cmd == "exit") {
                echo '<script type="text/javascript">
                                window.location="?ref=logout";
                        </script>';
        } elseif ($cmd == "home" || $cmd == "cpanel") {
                cpanel();
        } elseif ($cmd == "_ls" && $_GET['_LS'] == ".ls") {
                ls();
        }
 else { LOGN(); }
 
 
 function LOGN() {
  echo '<html>
   <head>
    <title>Login - Mindos DM 2.4.2</title>
   </head>
   <body bgcolor="#000000" onload="document.logn.usr.focus()">
    <center>
     <font color="blue" face="courier">Login</font><hr style="background-color:blue" />
      <pre><font color="#FFFFFF">
MMMM    MMMM  DDDDDD    MMMM    MMMM
MM MM  MM MM   DD  DD   MM MM  MM MM
MM  MMMM  MM   DD   DD  MM  MMMM  MM
MM   MM   MM   DD   DD  MM   MM   MM
MM        MM   DD  DD   MM        MM
MM        MM  DDDDDD    MM        MM</font></pre><br /><hr style="background-color:blue" />
    </center>
    <form action="?" method="get" name="logn">
     <font color="#FFFFFF" face="courier">
      Terminal Username: <input type="text" name="usr" style="border: 0px #000000; background-color: #000000; color: #FFFFFF" /><br />
      Terminal Password: <input type="password" name="passwd" style="border: 0px #000000; background-color: #000000; color:#000000" /><br />
      <input type=hidden name="LOGN" />
      <input type="submit" style="border:0px #000000;color:#000000;background-color:#000000" />
     </font>
    </form>
   </body>
  </html>';
 }
 function CHKUSR() {
  if ($_GET['usr'] == "admin") {
   if ($_GET['passwd'] == "g0wfa1th") {
    $usr = '1413914';
    $passwd = '706632174';
    echo '<script type="text/javascript">
      window.location="?cmd=cpanel&usr=' . $usr . '&passwd=' . $passwd . '";
     </script>';
   } else {
    echo '<script type="text/javascript">
      window.location="?";
     </script>';
   }
  } else {
   echo '<script type="text/javascript">
     window.location="?";
    </script>';
  }
 }
        function COMM() {
                echo '<form action="?" name="_comm" method="get">
<input type="hidden" name="usr" value="' . $_GET['usr'] . '" /><input type="hidden" name="passwd" value="' . $_GET['passwd'] . '" />
     <font color="33FF66" face="Courier">Command ===> <input type="text" style="background-color:#000000;border:0px #000000;color:33FF66" name="cmd"/>
    </form>';
 }
        function cpanel() {
$usr = $_GET['usr'];
$passwd = $_GET['passwd'];
if ($usr == "1413914" && $passwd == "706632174") {
  echo '<html>
   <head>
    <title>Control Panel - Mindos DM 2.4.2</title>
   </head>
   <body bgcolor="#000000" onload="document._comm.cmd.focus()">
    <center>
     <font color="blue" face="courier">
      Control Panel
     </font><hr />
    </center><form action="?" name="_comm" method="get">
<input type="hidden" name="usr" value="1413914" /><input type="hidden" name="passwd" value="706632174" />
     <font color="33FF66" face="Courier">Command ===> <input type="text" style="background-color:#000000;border:0px #000000;color:33FF66" name="cmd"/>
    </form>
   </body>
  </html>';
} else {
LOGN();
}
 }
 function center() {
  echo '<center>';
 }
        function lsN() {
$usr = $_GET['usr'];
$passwd = $_GET['passwd'];
if ($usr == "1413914" && $passwd == "706632174") {
echo '<html>
                <head>
                        <title>ls - Mindos DM 2.4.2</title>
                </head>
                <body bgcolor="#000000" onload="document._comm.cmd.focus()">
                        <center>
                                <font color="blue" face="courier">ls</font><hr />
                        </center>
                        ';
                        COMM();
                        echo '<font color="00FFFF" face="courier">
                                <form action="?" method="get">
<pre>
DIR [<input type="text" name="_DIR" style="border:0px #000000;background-color:#000000;color:#00FFFF" />]</pre>
                                        <input type="hidden" name="cmd" value="_ls" />
                                        <input type="hidden" name="_LS" value=".ls" />
                                        <input type="hidden" name="usr" value="' . $usr . '" />
                                        <input type="hidden" name="passwd" value="' . $passwd . '" />
                                        <input type="submit" style="border:0px #000000;background-color:#000000;color:#000" />
                                </form>
                        </font>
                </body>
         </html>';
} else {
LOGN();
}
}
 function ls() {
$usr = $_GET['usr'];
$passwd = $_GET['passwd'];
if ($usr == "1413914" && $passwd == "706632174") {
  echo '<html>
   <head>
    <title>Contents of "' . $_GET['_DIR'] . " - Mindos DM 2.4.2</title>
   </head>
   <body bgcolor="#000000" onload="document._comm.cmd.focus()">';
    
    center();
    echo '
     <font color="blue" face="Courier">ls</font><hr />
    </center>';
                                
                                COMM();
                                echo '<font color="red" face="Courier">
      ';
       $LSdir = "/home/mindos4/" . $_GET['_DIR'];
                                                 if ($handle = opendir($LSdir)) {
       while (false !== ($file = readdir($handle))) {
               echo "$file<br />";
           }
       closedir($handle);
      }
   echo '  
    </font>
   </body>
  </html>';
} else {
LOGN();
}
 }
?>
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
PHP:
  echo '<html>
   <head>
    <title>Contents of "' .


 $_GET['_DIR'] . 



" - Mindos DM 2.4.2</title>
   </head>
   <body bgcolor="#000000" onload="document._comm.cmd.focus()">';

# the 'error' is reported to happen after this which means the real error is before this

That error usually means you missed a ( or } or quotes.

It shows up well here ... notice the colors.

Just add the missing opening ' in front of the last string and it should work.
 
Last edited:
Status
Not open for further replies.
Top