Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default [Kane] PHP ~ Where?

    Ok here is a code for my admin Panel,

    and this is the error i get when i click it

    Code:
    Parse error:  parse error, unexpected $ in /home/admincpp.php on line 478


    But where is the un expected ''$''?

    Code:
    '$ban_username'"); 
        echo "<td><font color=red>That user is now banned!</font></td>";
                    
    
    }} ?>
    
    
    
    
    
    <form name="form1" method="post" action="?op=ban">
      <table width="67%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="<?php echo "$td_border"; ?>" bgcolor="<?php echo "$td_bg"; ?>">
        <tr> 
          <td height=22 background="<?php echo"$gradient"; ?>"><center class="TableHeading">
              <strong>Ban a user</strong> </center></td>
        </tr>
        <tr> 
          <td><table width="100%" border="0" cellspacing="3" cellpadding="0">
              <tr> 
                <td width="50%">Username</td>
                <td width="50%"><input name="ban_username" type="text" id="ban_username"></td>
              </tr>
              <tr> 
                <td width="50%">Rank</td>
                <td width="50%"><input name="ban_rank" type="text" id="ban_username"></td>
              </tr>
    
    
              <tr> 
                <td>Length(Levae blank for permanent ban).</td>
                <td><input name="time" type="text" id="time">
                  Days</td>
              </tr>
              <tr> 
                <td>Reason</td>
                <td><textarea name="ban_reason" cols="40" rows="7" id="ban_reason"></textarea></td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
                <td><input name="Ban" type="submit" id="Ban" value="Ban this user"></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </form>
    <p><br>
      <br>
    </p>
    </body>
    </html>
    <?
    
    }elseif (strip_tags($_GET['op']) == "lvlc"){
    $uname=strip_tags($_POST['jjj']);
    $ulevel=strip_tags($_POST['userlevel']);
    $state=strip_tags($_POST['state']);
    $flow=strip_tags($_POST['flow']);
    $cash=strip_tags($_POST['cash']);
    
    if($uname && $ulevel && $state){
    if($ulevel!="0" && $ulevel!="1" && $ulevel!="2"){ die("Can't do!");}
    if($state!='Alive' && $state!='Banned' && $state!='Dead'){ die("Can't do!!");}
    if($ulevel!=0 && $fetch->userlevel!=2){ die("You're not allowed to promote this person!");}
    if($flow=='0' || $flow=='1'){
        if($cash){
            if($flow==0){
            mysql_query("UPDATE users SET money=money+$cash WHERE username='$uname'");
            print"Succesfully gave $cash to $uname!";
            }else{
            mysql_query("UPDATE users SET money=money-$cash WHERE username='$uname'");
            print"Succesfully took $cash from $uname!";
            }
        }
    }
    
    if($uname!="Error"){
    mysql_query("UPDATE users SET userlevel='$ulevel' WHERE username='$uname'") or die("Can't do!!!");
    mysql_query("UPDATE users SET status='$state' WHERE username='$uname'") or die("Can't do!!!!");
    print"Succesfully changed state to $state and userlevel to $ulevel from $uname!";
    }
    }
    
    ?>
    <form name="form1" method="post" action="?op=lvlc">
      <table width="67%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="<?php echo "$td_border"; ?>" bgcolor="<?php echo "$td_bg"; ?>">
        <tr> 
          <td height=22 background="<?php echo"$gradient"; ?>"><center class="TableHeading">
              <strong>Change Userlevel</strong> </center></td>
        </tr>
        <tr> 
          <td><table width="100%" border="0" cellspacing="3" cellpadding="0">
              <tr> 
                <td width="50%">Username</td>
                <td width="50%">
                <input name="jjj" type="text" id="ban_username" size="20"></td>
              </tr>
              <tr> 
                <td width="50%">Cash</td>
                <td width="50%">
                <input name="cash" type="text" id="cashflow" size="20"></td>
            <select size="1" name="flow">
                <option value="0">Give</option>
                <option value="1">Take</option>
            </select>
              </tr>
              <tr> 
                <td>Userlevel:</td>
                <td><select size="1" name="userlevel">
                <option value="0">Player</option>
                <option value="1">Moderator</option>
                <option value="2">Admin</option>
                </select></td>
              </tr>
              <tr> 
                <td>State:</td>
                <td><select size="1" name="state">
                <option value="Alive">Alive</option>
                <option value="Banned">Banned</option>
                <option value="Dead">Dead</option>
                </select></td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
                <td>
                <input name="change" type="submit" id="Ban" value="Change level!"></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </form>
    <p><br>
      <br>
    </p>
    </body>
    </html>
    <?php
    
    
    
    }elseif (strip_tags($_GET['op']) == "war"){
    if (strip_tags($_POST['warning_username']) && strip_tags($_POST['warning_msg'])){
    $warning_username=strip_tags($_POST['warning_username']);
    $warning_msg=strip_tags($_POST['warning_msg']);
    $check=mysql_num_rows(mysql_query("SELECT * FROM users WHERE username='$warning_username'"));
    if ($check =="0"){
    echo "No such user!";
    }elseif($check !="0"){
    mysql_query("INSERT INTO `inbox` ( `id` , `to` , `from` , `message` , `date` , `read` , `saved` , `event_id` ) 
    VALUES (
    '', '<font colour=blue>$warning_username</font>', '$warning_username', '$warning_msg You Have BEEN warned!', '$date', '0', '0', '0'
    )");
    echo "Warning Issued";
    
    
    }}
    
    ?>
    <form action="?op=war" method=POST>
    <table width="67%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="<?php echo "$td_border"; ?>" bgcolor="<?php echo "$td_bg"; ?>">
      <tr> 
        <td height=22 background="<?php echo"$gradient"; ?>"><center class="TableHeading">
            <strong>Send warning</strong> 
          </center></td>
      </tr>
      <tr> 
        <td><table width="100%" border="0" cellspacing="3" cellpadding="0">
            <tr> 
              <td colspan="2">This will send an offical warning into the users inbox.</td>
            </tr>
            <tr> 
              <td width="49%">Username:</td>
              <td width="51%"><input name="warning_username" type="text" maxlength="40"></td>
            </tr>
            <tr> 
              <td>Message:</td>
              <td><input name="warning_msg" type="text" maxlength="100"></td>
            </tr>
            <tr> 
              <td colspan="2"><div align="center">
                  <input name="Send" type="submit" id="Send" value="Send warning">
                </div></td>
            </tr>
          </table></td>
      </tr>
    </table></form><?
    
    
    }elseif (strip_tags($_GET['op']) == "forum"){
    if (strip_tags($_POST['dall']) && strip_tags($_POST['dallbut'])){
    $dall=strip_tags($_POST['dall']);
    $check=mysql_num_rows(mysql_query("SELECT * FROM users WHERE username='$dall'"));
    if ($check =="0"){
    echo "No such user!";
    }elseif($check !="0"){
    mysql_query("DELETE FROM topics WHERE username='$dall'");
    echo "".mysql_affected_rows()." topics deleted";
    mysql_query("DELETE FROM replys WHERE username='$dall'");
    
    echo "".mysql_affected_rows()." replys deleted";
    
    }}elseif (strip_tags($_POST['stick']) && strip_tags($_POST['sticky_but'])){
    $stick=strip_tags($_POST['stick']);
    
    $check1=mysql_query("SELECT * FROM topics WHERE id='$stick'");
    $check=mysql_num_rows($check1);
    $chech=mysql_fetch_object($check1);
    $new_***="<b>$chech->title</b>";
    
    if ($check == "0"){
    echo "Invalid ID";
    }elseif($check != "0"){
    mysql_query("UPDATE topics SET sticky='1', lastreply='999999999999999', title='$new_***' WHERE id='$stick'");
    echo "Sticky topic made";
    
    }}elseif (strip_tags($_POST['lock']) && strip_tags($_POST['locky_but'])){
    $lock=strip_tags($_POST['lock']);
    
    $check=mysql_num_rows(mysql_query("SELECT * FROM topics WHERE id='$lock'"));
    if ($check == "0"){
    echo "Invalid ID";
    }elseif($check != "0"){
    mysql_query("UPDATE topics SET locked='1' WHERE id='$lock'");
    echo "Topic locked";
    
    }}
    
    
    ?><form action="?op=forum" method=POST>
    <table width="67%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="<?php echo "$td_border"; ?>" bgcolor="<?php echo "$td_bg"; ?>">
      <tr> 
        <td height=22 background="<?php echo"$gradient"; ?>"><center class="TableHeading">
            <strong>Forum options</strong> 
          </center></td>
      </tr>
      <tr> 
        <td><table width="100%" border="0" cellspacing="3" cellpadding="0">
            <tr> 
              <td colspan="2"><div align="center">Delete all posts/topics made by 
                  a user</div></td>
            </tr>
            <tr> 
              <td width="49%">Username:</td>
              <td width="51%"><input name="dall" type="text" maxlength="40"> 
                <input name="dallbut" type="submit" id="Send22" value="Delete"></td>
            </tr>
            <tr> 
              <td colspan="2"><div align="center">Make a sticky topic</div>
                <div align="center"> </div></td>
            </tr>
            <tr> 
              <td>Topic ID</td>
               <td><input name="Sticky" type="text" id="lock_id"> <input name="Sticky_but" type="submit" id="Stick" value="Sticky"></td>
            </tr>
            <tr> 
              <td colspan="2"><div align="center">Lock a topic</div></td>
            </tr>
            <tr> 
              <td>Topic ID</td>
              <td><input name="lock" type="text" id="lock_id"> <input name="locky_but" type="submit"id="Stick" value="Lock"></td>
            </tr>
          </table></td>
      </tr>
    </table></form>
    <?
    
    
    }
    
    
    
    
    ?>
    
    
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    
      <tr> 
        <td height=22 background="includes/grad.jpg"><center class="TableHeading">
            <strong><font size=6>AdminCP</strong> 
          </center></td>
      </tr>
      <tr> 
        <td><table width="100%" border="0" cellspacing="3" cellpadding="0">
            <tr> 
              <td>&nbsp;</td>
            </tr>
    
    <tr><td>
    <?php if ($fetch->userlevel != "0"){
    echo "
      <tr>
        <td><a href=\"whokilled.php\" target=\"main\"><center><b><font color=white></font></center></a></td>
      <tr>";
    }
    ?>
    
    
    <tr><td><a href=dupeschecks.php><center><b><font size=2><font color=white>Dupe check</a></td>
            </tr>
            <tr> 
              <td><a href="?op=ban"><center><b><font color=white><font size=2>Ban</a></td>
            </tr>
             <tr> 
              <td><a href="football/index.php?do=add_form&page=1"><center><b><font size=2><font color=white>Add a Bet to Football Bets Page</a></td>
            </tr>
    <tr> 
              <td><a href="football/index.php?do=del&id=&page=1"><font color=white><center><b><font color=white><font size=2>Delete a Bet from Football Bets Page</a></td>
            </tr>
            <tr> 
              <td><a href="?op=war"><center><b><font size=2><font color=white>Send warning</a></td>
            </tr>
            <tr> 
              <td><a href="?op=forum"><center><b><font color=white><font size=2>Forum options</a></td>
            </tr>
            <tr> 
              <td><a href="oeticket.php"><center><b><font size=2><font color=white>Ticket system</a></td>
            </tr>
    
     <tr> 
              <td><a href="bank_transfers_submit.php"><center><b><font size=2><font color=white>Check Money Transfers</a></td>
            </tr>
    
      <tr> 
              <td><a href="ipshare.php"><center><b><font color=white><font size=2>Ip Sharing Book </a>
            </tr>
    
    
            <tr> 
              <td><a href="mass.php"><center><b><font size=2><font color=white>Mass Mail</a></td>
            </tr>
    
    
        <tr> 
              <td><a href="clear_profile_submit.php"><center><b><font color=white><font size=2>Clear a Profile</a></td>
            </tr>
    <tr> 
              <td><a href="health_increase_submit.php"><center><b><font color=white><font size=2>Give 1000% HP</a></td>
            </tr>
    
    <tr>
                  <td><a href="give_points_submit.php"><center><b><font color=white><font size=2>Give Points</a></td>
            </tr>
    
    
    <tr>
                  <td><a href="give_bullets_submit.php"><center><b><font color=white><font size=2>Give Bullets</a></td>
            </tr>
    <tr>
                  <td><a href="give_health_submit.php"><center><b><font size=2 color=white>Give Health</a></td>
            </tr>
    
    
    <tr>
                  <td><a href="give_money_submit.php"><center><b><font color=white><font size=2>Give Money</a></td>
            </tr>
    
    
      <tr>
                  <td><a href="take_money_submit.php"><center><b><font color=white><font size=2>Take Money</a></td>
            </tr>
        
          
    <td><a href="view_user_mail_submit.php"><center><b><font size=2><font color=white>View Last Sent Mail By User</a></td>
            </tr>
            <tr>
             <td><a href="view_user_received_submit.php"><center><b><font color=white><font size=2>View Last Received Mail By User</a></td>
            </tr>
            <tr>
             <td><a href="kill_user_submit.php"><center><b><font size=2><font color=white>Modkill</a></td>
            </tr>
    <tr>
             <td><a href="de-mod_user_submit.php"><center><b><font color=white><font size=2>De-Mod a Mod</a></td>
            </tr>
    <tr>
             <td><a href="revive_user_submit.php"><center><b><font color=white><font size=2>Revive</a></td>
            </tr>
    
    <tr>
             <td><a href="admin_user_submit.php"><center><b><font size=2><font color=white>Change User Crew</a></td>
            </tr>
    
    <tr>
             <td><a href="mod_user_submit.php"><center><b><font size=2><font color=white>Make user Mod</a></td>
            </tr>
    
    
    
    <tr>
             <td><a href="ownerusersubmit.php"><center><b><font size=2><font color=white><font color=white>Make user Admin</a></td>
            </tr>
    
    
    
    
             <tr>
             <td><a href="view_user_stats_submit.php"><center><b><font size=2><font color=white>View a User's Stats</a></td>
            </tr>
    
    <tr>
             <td><a href="hdo_user_submit.php"><center><b><font size=2><font color=white>Make user HDOP</a></td>
            </tr>
    <tr>
    <tr>
             <td><a href="de-hdo_user_submit.php"><center><b><font size=2><font color=white>Sack a HDOP</a></td>
            </tr>
    <tr>
             <td><a href="ghost_mode.php"><center><b><font size=2><font color=white>Ghost Mode</a></td>
            </tr>
    <tr>
             <td><a href="forummod_submit.php"><center><b><font size=2><font color=white>Make a User a Forum Mod</a></td>
            </tr>
    <tr>
             <td><a href="?op=ban"><center><b><font size=2><font color=white>Ban a User</a></td>
            </tr>
    <tr>
             <td><a href="sack_forummod.php"><center><b><font size=2><font color=white>Sack a Forum Mod</a></td>
            </tr>
    <tr>
    
          </table></td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    
    <? }} ?>
    Rep+ For answer.
    Last edited by Assassinator; 23-06-2007 at 08:01 PM.

  2. #2
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    Is that the start of the code?
    Looking for a good desiner to design a social networking template.

    PM me.

  3. #3
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default

    Its the full code.

    I Need to find the un-expected ''$''

  4. #4
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    there is no line 478
    Looking for a good desiner to design a social networking template.

    PM me.

  5. #5
    Join Date
    Jan 2007
    Posts
    825
    Tokens
    0

    Default

    Its The Wrong File................
    That post was really sensible!

  6. #6
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default

    Nvm people lol.

    I Made a brand new panel.

  7. #7
    Join Date
    Jun 2004
    Location
    London
    Posts
    116
    Tokens
    0

    Default

    That means that there is a missing '{' or '}' OR there is an extra '{' or '}'

    ie:
    PHP Code:
    <?
    if($a) {
    if (
    $b) {
    echo 
    "$b";
    }
    ?>

  8. #8
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Thats not true, if it was like you said then you would get a parse error on the very last line.

    Quote Originally Posted by * View Post
    That means that there is a missing '{' or '}' OR there is an extra '{' or '}'

    ie:
    PHP Code:
    <?
    if($a) {
    if (
    $b) {
    echo 
    "$b";
    }
    ?>
    Last edited by Tomm; 26-06-2007 at 03:25 PM.

  9. #9
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Thought you could code Fluently? Sorry but most beginners know that?

    Add a } on the last line (of php..)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •