Parse error: syntax error, unexpected ‘<' in

Discussion in 'PHP' started by Luckysacrifice, Feb 28, 2011.

  1. #1
    I'm pasting a PHP code on a page on my wordpress blog using http://wordpress.org/extend/plugins/exec-php/ and i get this error.

    Parse error: syntax error, unexpected ‘<' in /home/glacialg/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 897

    Here is the the part of code where i have problems:

    
     <?php get_sidebar(); ?> 
    <?php get_footer(); ?>
    
    
    Code (markup):
    http://www.glacialgaming.com/create-account
     
    Luckysacrifice, Feb 28, 2011 IP
  2. Luckysacrifice

    Luckysacrifice Peon

    Messages:
    344
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Here is more of the code
    
    <?php
        if ($onlineoption == 1) {
          echo"$list";
        }
        else {
          echo "<tr>
                  <td colspan=6><center><strong><font face=\"Arial\" color=\"#FF0000\" size=\"2\"><br>".$text['onlinemessage']."</font></strong></center>
                  </td>
                </tr>";
        }
        echo "
                <tr class=txt>
                  <td colspan=6 style=\"text-align:center;padding-top:20px;\">".$text['last_refresh'].": ".strftime("%d.%m.%Y  %H:%M:%S")." (".($cfg_ptable_refresh/1000)." sec.)<br><br></td>
                 </tr>";
    
    ?>
                      </tbody>
                    </table>
                    </div>
    
                  </td>
                  <td width=124><img height=1 src="<?php print $img_base ?>pixel.gif" width=124 alt="">
                  </td>
                </tr>
                <tr>
                  <td colSpan=3><img height=100 src="<?php print $img_base ?>pixel.gif" width=1 alt="">
                  </td>
                </tr>
                </tbody>
              </table>
            </td>
          </tr>
          </tbody>
        </table>
    
    
        </td>
      </tr>
      </tbody>
    </table>
    </form>
    
    <?php 
    
    <?php get_sidebar(); ?> 
    <?php get_footer(); ?>
    
    //Please Dont Edit This Copyright Lines , Respect To Our Work
    foorat($copyright);
    ?>
    </body>
    </html>
    
    Code (markup):
     
    Luckysacrifice, Feb 28, 2011 IP
  3. themullet

    themullet Member

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    problems at

    <?php

    <?php get_sidebar(); ?>
     
    themullet, Feb 28, 2011 IP
  4. themullet

    themullet Member

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #4
    remove the first <?php and you should be ok
     
    themullet, Feb 28, 2011 IP
  5. Luckysacrifice

    Luckysacrifice Peon

    Messages:
    344
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Luckysacrifice, Feb 28, 2011 IP
  6. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #6
    Change the last few lines to this:

    
    </form>
    
    
    
    <?php get_sidebar(); ?> 
    <?php get_footer(); ?>
    <?php 
    //Please Dont Edit This Copyright Lines , Respect To Our Work
    foorat($copyright);
    ?>
    </body>
    
    PHP:
    Note the position of the last opening <?php tag

    If this still throws out an error and or the sidebar/footer are messed up, post here the codes for those
     
    MyVodaFone, Mar 1, 2011 IP
  7. Luckysacrifice

    Luckysacrifice Peon

    Messages:
    344
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi,

    I changed the last few lines and it gets rid of the errors but it gets rid of the footer and sidebars.

    I have pasted the complete code on Pastebin so you can see the whole code i am using

    http://pastebin.com/c5j5sJLK
     
    Luckysacrifice, Mar 1, 2011 IP
  8. dgshonk

    dgshonk Peon

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    UGH!!! I am having the same issue! Help fast would be great! :D
     
    dgshonk, Mar 1, 2011 IP