unexpected T_CASE error
Results 1 to 4 of 4

Thread: unexpected T_CASE error

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Posts
    5

    unexpected T_CASE error

    I have a proxy script that I am trying to get working on my server but for some reason everytime I try to go to the site it gives me an error that looks like this:
    Code:
    Parse error: syntax error, unexpected T_CASE in /home/p33n0r/public_html/index.php on line 27
    This is lines 20-30 in index.php:
    Code:
      </style>
    </head>
    <body onload="document.getElementById('address_box').focus()">
    <div id="container">
      <h1 align="center" class="style1" id="title"><font color="#FFFFFF" size="+4"><u>p33n0r</u></font></h1>
      <?php
            break;
        case 'error':
            echo '<div id="error"><p>';
            
            switch ($data['group'])
    I have hosted this EXACT SAME SCRIPT on a few other php hosting sites and it works (fairly well) and doesn't give me this error. Here is some statistics of the server:
    PERL version 5.8.7
    PHP version 4.4.3
    Apache version 1.3.37 (Unix)
    MySQL version 4.1.22-standard

    Thanks in advance!

    EDIT: I just got help on this from different forums but now a new problem concerning the same script has occured. It is just a little bit different but here it is:

    Now the error says:
    Parse error: syntax error, unexpected T_STRING in /home/p33n0r/public_html/piss/index.php on line 45

    Line 40-50:
    Code:
     break;
    case 'external':
    switch ($data['error'])
    {
    case 1:
    $message = 'The URL you have tried is black listed';
    break;
    case 2:
    $message = 'You spelled the URL wrong';
    break;
    }
    Last edited by seargentpepper7; 04-15-2007 at 08:40 PM.

  2. #2
    Senior Member
    Join Date
    Mar 2003
    Location
    England
    Posts
    281
    T_CASE errors are relating switch statements, and T_STRING errors are, well, relating unexpected strings.

    The line number reported in the error isn't necessarily where the error is. What usually happens is that you've missed a single/double quote somewhere higher up the code, which causes the problem lower down.

    Have a look through the code and see if you have missed any punctuation. No quick solution, unfortunately, but a little perseverance will get you to the solution!

  3. #3
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,905
    Quote Originally Posted by pete_bisby
    The line number reported in the error isn't necessarily where the error is. What usually happens is that you've missed a single/double quote somewhere higher up the code, which causes the problem lower down.
    This would be picked up if you use syntax highlighting; bits of code would be coloured as literal strings, and vice versa. (This is one reason why this board has &#91;php]..[/php] tags for posting PHP code, and is also one of the reasons for functions like highlight_string.)
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  4. #4
    Senior Member
    Join Date
    Jul 2006
    Posts
    1,960
    Really nice function Weedpacket. Didn't know anything like that existed, but now when I know I will be sure to use it
    Make sure that you read all answers and try them out before asking additional questions.

    Please google keywords you don't understand.

    If you can't be bothered to do the two things above I can't be bothered to answer additional questions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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