+ Reply to Thread
Results 1 to 5 of 5

Thread: Dj Admin Panel ---Errors---

  1. #1
    Shadow121's Avatar
    Shadow121 is offline x10 Lieutenant Shadow121 is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Centerville
    Posts
    455

    Dj Admin Panel ---Errors---

    The Error
    Code:
    Parse error:  parse error, unexpected T_CASE in C:\Program Files\VertrigoServ\www\admin.php on line 144
    
    My code i have is:
    PHP Code:
    <?php
    ob_start
    ();
    include(
    "config.php");
    //space
    //space
    switch($_GET[action])
    {

    case 
    '':
    //dunno
    break;

    case 
    '':
    //dunno
    break;

    case 
    '':
    //dunno
    break;

    case 
    '':
    //dunno
    break;

    case 
    'editdj':
    if(
    $logged[username] && $logged[level] ==5)
    {
    //checks to see if the user is logged in, and if their user level
    //is 5 (this is administrator)
    if($_GET[user])
    {
    //checks to see if there is a ?user=username variable in the url.
    if (!$_POST[update])
    {
    // the form hasn't been submitted.  We continue...
    $user mysql_query("SELECT * from users where username = '$_GET[user]'");
    $user mysql_fetch_array($user);
    //these lines get the user's information and put it in an array.
    //we will display the information in the html form
    echo("
    <div align=\"center\"><form method=\"POST\">
    <table width=\"100%\">
    <tr>
    <td align=\"right\" width=\"25%\">
    User Level 
    </td>
    <td align=\"left\">
    <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"level\"
    value=\"
    $user[level]\"></td>
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\">
    Location 
    </td>
    <td align=\"left\">
    <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"locate\"
    value=\"
    $user[location]\"></td>
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\">
    MSN Messenger 
    </td>
    <td align=\"left\">
     <input size=\"25\" name=\"msn\" value=\"
    $user[msn]\"></td>
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\">
    AOL Messenger</td>
    <td align=\"left\">
     <input size=\"25\" name=\"aim\"  value=\"
    $user[aim]\"></td>
    </tr>
    <tr>
    <td align=\"right\" width=\"25%\">
    Email Address</td>
    <td align=\"left\">
     <input size=\"25\"  name=\"email\" value=\"
    $user[email]\"></td>
    </tr>
    <tr>
    <td align=\"center\">
     </td>
    <td align=\"left\">
     <input type=\"submit\" name=\"update\" value=\"Update\"></td>
    </tr>
    </table>
    </form>
    </div>"
    );
    //displays the html form
    }
    else
    {
    $email htmlspecialchars($_POST[email]);
    $aim htmlspecialchars($_POST[aim]);
    $msn htmlspecialchars($_POST[msn]);
    $locate htmlspecialchars($_POST[locate]);
    $level htmlspecialchars($_POST[level]);
    // the above lines get rid of all html.
    echo ("$_GET[user]'s profile has been updated.");
    $update mysql_query("Update users set email = '$email',
    msn = '
    $msn', aim = '$aim',
    location = '
    $locate', level = '$level' where username = '$_GET[user]'");
    // updates the information in the database.
    }
    }
    else
    {
    $getusers mysql_query("Select * from users order by username asc");
    while(
    $users mysql_fetch_array($getusers))
    {
    //makes a list of all the users
    echo("<a href=\"admin.php?user=$users[username]\">$users[username]</a><br />");
    //displays the user's names
    }
    }
    }
    else
    {
    //the user's level is not 5!  They cannot view this page
    echo("Sorry, but you are not allowed to view this page!");

    break;

    case 
    'djsays':
    if(
    $logged[username] && $logged[level]== || 5){
    if(!
    $_POST[djupdate]){
    echo 
    "
    <center>
    <form action=\"?action=djsays&updatedjsays=1\" method=\"POST\">
    <b>DJ Message</b>:&nbsp;&nbsp;<textarea name=\"message\" cols=\"35\"></textarea><br />
    <input type=\"submit\" name=\"djupdate\" value=\"Set Dj Says\">
    "
    ;
    if(
    $_GET[updatedjsays] == 1){
    if(
    $_POST[djupdate]){
    $username $logged[username];
    $message stripslashes(addslashes($_POST[message]));
    echo 
    "<b>DJ</b>: $username <b>Said</b>: $message";
    mysql_query("UPDATE djsays SET username = '$username', message = '$message' WHERE id = '1'");
    }elseif(
    $logged[username] && $logged[level] == 1){
    echo 
    "Your Not A Dj Or An Admin";
    }else{
    echo 
    "Your Not Logged In";
    }
    break;

    case 
    'adminsays':
    if(
    $logged[username] && $logged[level] == 5)
    {
    echo 
    "<form action='admin.php?action=staffnotes&updatestaffnotes=1' method='post'>
    <textarea name='notes' id='notes' style='background-color:#F9FFA2;border:1px solid #CCC;width:95%;font-family:verdana;font-size:10px' rows='8' cols='25'>"
    ;include("staffnotes.php"); $sn $notes; echo "$sn";echo "</textarea>
    <br>
    <div align='center'><input type='submit' name='Submit' value='Save Admin Notes'></div></form>"
    ;
    if (
    $_GET['updatestaffnotes'] == 1)
    {
    if(
    $_POST['Submit']) {
            
      if (!
    is_file("staffnotes.php"))
      {
       die (
    "Error: The File <b>staffnotes.php</b> Doesn't Exist");
      }

      if (!
    is_writeable("staffnotes.php"))
      {
       die (
    "Error: The File <b>staffnotes.php</b> is NOT Writable....Please CHMOD to 777");
      }

      
    $sn1  $_POST['notes'];

      
      
    $body '<?php $notes = "'.$sn1.'"; ?>';

      
    $fp fopen("staffnotes.php""w");

      
    fputs($fp$body);
      
    fclose($fp);
      echo 
    "<br><center>The Staff Notes Have Been Updated</center><br>";   
    }
    else {
      echo 
    "Error: Please Do Not Visit This Link Directly";
    }


    }else{
    echo 
    "You Are Not An Admin";
    }
    break;

    }
    //End Switch Get
    ?>
    Last edited by Shadow121; 09-09-2006 at 02:37 AM.

  2. #2
    swrpg is offline x10Hosting Member swrpg is an unknown quantity at this point
    Join Date
    Aug 2006
    Posts
    31

    Re: Dj Admin Panel ---Errors---

    what is on line 144

  3. #3
    dann109 is offline x10Hosting Member dann109 is an unknown quantity at this point
    Join Date
    Sep 2006
    Posts
    2

    Re: Dj Admin Panel ---Errors---

    line 144: case 'adminsays':

  4. #4
    Corey's Avatar
    Corey is offline VPS Migration Professional Corey is a glorious beacon of lightCorey is a glorious beacon of light
    Join Date
    Dec 2004
    Location
    Northfield, NH
    Posts
    17,152

    Re: Dj Admin Panel ---Errors---

    I'm going to guess it's because you're forgetting some } in the djsays case statement. Right now it looks like the adminsays case is going underneath one of the IFs from djsays.

    -Corey

  5. #5
    nightscream is offline x10 Lieutenant nightscream is an unknown quantity at this point
    Join Date
    Feb 2006
    Location
    Hallaar, Belgium
    Posts
    474

    Re: Dj Admin Panel ---Errors---

    try this one, it would be better to find the error if you have some structure in it
    PHP Code:
    <?php
    ob_start
    ();
    include(
    "config.php");
    //space
    //space
    switch($_GET[action]) {

        case 
    '':
        
    //dunno
        
    break;

        case 
    '':
        
    //dunno
        
    break;

        case 
    '':
        
    //dunno
        
    break;
        
        case 
    '':
        
    //dunno
        
    break;

        case 
    'editdj':
            if(
    $logged[username] && $logged[level] ==5) {
                
    //checks to see if the user is logged in, and if their user level
                //is 5 (this is administrator)
                
    if($_GET[user]) {
                    
    //checks to see if there is a ?user=username variable in the url.
                    
    if (!$_POST[update]) {
                        
    // the form hasn't been submitted.  We continue...
                        
    $user mysql_query("SELECT * from users where username = '$_GET[user]'");
                        
    $user mysql_fetch_array($user);
                        
    //these lines get the user's information and put it in an array.
                        //we will display the information in the html form
                        
    echo("
                            <div align=\"center\"><form method=\"POST\">
                            <table width=\"100%\">
                            <tr>
                            <td align=\"right\" width=\"25%\">
                            User Level 
                            </td>
                            <td align=\"left\">
                            <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"level\"
                            value=\"
    $user[level]\"></td>
                            </tr>
                            <tr>
                            <td align=\"right\" width=\"25%\">
                            Location 
                            </td>
                            <td align=\"left\">
                            <input type=\"text\" size=\"25\" maxlength=\"25\" name=\"locate\"
                            value=\"
    $user[location]\"></td>
                            </tr>
                            <tr>
                            <td align=\"right\" width=\"25%\">
                            MSN Messenger 
                            </td>
                            <td align=\"left\">
                             <input size=\"25\" name=\"msn\" value=\"
    $user[msn]\"></td>
                            </tr>
                            <tr>
                            <td align=\"right\" width=\"25%\">
                            AOL Messenger</td>
                            <td align=\"left\">
                             <input size=\"25\" name=\"aim\"  value=\"
    $user[aim]\"></td>
                            </tr>
                            <tr>
                            <td align=\"right\" width=\"25%\">
                            Email Address</td>
                            <td align=\"left\">
                             <input size=\"25\"  name=\"email\" value=\"
    $user[email]\"></td>
                            </tr>
                            <tr>
                            <td align=\"center\">
                             </td>
                            <td align=\"left\">
                             <input type=\"submit\" name=\"update\" value=\"Update\"></td>
                            </tr>
                            </table>
                            </form>
                            </div>"
    );
                        
    //displays the html form
                    
    }
                    else
                    {
                        
    $email htmlspecialchars($_POST[email]);
                        
    $aim htmlspecialchars($_POST[aim]);
                        
    $msn htmlspecialchars($_POST[msn]);
                        
    $locate htmlspecialchars($_POST[locate]);
                        
    $level htmlspecialchars($_POST[level]);
                        
    // the above lines get rid of all html.
                        
    echo ("$_GET[user]'s profile has been updated.");
                        
    $update mysql_query("Update users set email = '$email',
                        msn = '
    $msn', aim = '$aim',
                        location = '
    $locate', level = '$level' where username = '$_GET[user]'");
                        
    // updates the information in the database.
                    
    }
                }
                else
                {
                    
    $getusers mysql_query("Select * from users order by username asc");
                    while(
    $users mysql_fetch_array($getusers))
                    {
                        
    //makes a list of all the users
                        
    echo("<a href=\"admin.php?user=$users[username]\">$users[username]</a><br />");
                        
    //displays the user's names
                    
    }
                }
            }
            else
            {
                
    //the user's level is not 5!  They cannot view this page
                
    echo("Sorry, but you are not allowed to view this page!");
            } 
            break;
        
        case 
    'djsays':
            if(
    $logged[username] && $logged[level]== || 5){
                if(!
    $_POST[djupdate]){
                    echo 
    "
                        <center>
                        <form action=\"?action=djsays&updatedjsays=1\" method=\"POST\">
                        <b>DJ Message</b>:&nbsp;&nbsp;<textarea name=\"message\" cols=\"35\"></textarea><br />
                        <input type=\"submit\" name=\"djupdate\" value=\"Set Dj Says\">
                        "
    ;
                }
                if(
    $_GET[updatedjsays] == 1){
                    if(
    $_POST[djupdate]){
                        
    $username $logged[username];
                        
    $message stripslashes(addslashes($_POST[message]));
                        echo 
    "<b>DJ</b>: $username <b>Said</b>: $message";
                        
    mysql_query("UPDATE djsays SET username = '$username', message = '$message' WHERE id = '1'");
                    }else if(
    $logged[username] && $logged[level] == 1){
                        echo 
    "Your Not A Dj Or An Admin";
                    }
                }
            }else{
                echo 
    "Your Not Logged In";
            }
            break;

        case 
    'adminsays':
            if(
    $logged[username] && $logged[level] == 5) {
                echo 
    "<form action='admin.php?action=staffnotes&updatestaffnotes=1' method='post'>
                    <textarea name='notes' id='notes' style='background-color:#F9FFA2;border:1px solid #CCC;width:95%;font-family:verdana;font-size:10px' rows='8' cols='25'>"
    ;include("staffnotes.php"); $sn $notes; echo "$sn";echo "</textarea>
                    <br>
                    <div align='center'><input type='submit' name='Submit' value='Save Admin Notes'></div></form>"
    ;
                if (
    $_GET['updatestaffnotes'] == 1) {
                    if(
    $_POST['Submit']) {
                        if (!
    is_file("staffnotes.php")) {
                            die (
    "Error: The File <b>staffnotes.php</b> Doesn't Exist");
                        }

                          if (!
    is_writeable("staffnotes.php")) {
                               die (
    "Error: The File <b>staffnotes.php</b> is NOT Writable....Please CHMOD to 777");
                          }

                          
    $sn1  $_POST['notes'];

      
                          
    $body '<?php $notes = "'.$sn1.'"; ?>';

                          
    $fp fopen("staffnotes.php""w");

                        
    fputs($fp$body);
                          
    fclose($fp);
                        echo 
    "<br><center>The Staff Notes Have Been Updated</center><br>";
                    }else {
                        echo 
    "Error: Please Do Not Visit This Link Directly";
                    }
                } 
            }else{
                echo 
    "You Are Not An Admin";
            }
            break;
    }
    //End Switch Get
    ?>
    ------------------------------------------------------------------------------------------
    If you have any troubles with a website or a script, just send me a pm.

    I also code websites in xHTML/css, can code javascript and php too if needed

+ Reply to Thread

Similar Threads

  1. Ads in joomla Admin Panel
    By masterchief3k in forum Free Hosting
    Replies: 2
    Last Post: 07-17-2006, 10:38 PM
  2. The user panel
    By -Mike- in forum Feedback and Suggestions
    Replies: 9
    Last Post: 03-21-2006, 02:18 PM
  3. Hiring PHP Coder, and Template Designer($$)
    By Arucard98 in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 02-06-2006, 02:10 PM
  4. Coppermine picture upload errors
    By mygalleries in forum Free Hosting
    Replies: 4
    Last Post: 09-17-2005, 09:37 AM
  5. I need my Control Panel info
    By The Game in forum Free Hosting
    Replies: 5
    Last Post: 08-20-2005, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers