Why when upgrading my web server I get unexpected $end

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LordZyse
    New Member
    • Aug 2009
    • 4

    Why when upgrading my web server I get unexpected $end

    Just so everyone can know, I would LOVE to stay with yellowtip webserver, if you know how to install the GD files to it PLEASE let me know.

    This php worked on my 4.x php server but I get unexpected end with any other.

    Needless to say I only upgraded to 5.2 because

    Yellowtip web server 2.0's php did not come with the GD librarys which I needed to upload pics using mini file host.

    If you can fix ethier problem I would be so greatful

    herse the current problem
    unexpected $end
    line 165 which is the end of file

    Code:
    <?php
    
    
    include("./config.php");
    include("./header.php");
    
    $userip=$_SERVER['REMOTE_ADDR'];
    $time=time();
    
    ///////////////////////////////////////////TIMER////////////////////////////////////
    
    if(file_exists("./uploader/".$userip.".mfh"))
    {
    
    $downloaders = fopen("./uploader/".$userip.".mfh","r+");
    flock($downloaders,2);
    
    while (!feof($downloaders)) {
      $user[] = chop(fgets($downloaders,65536));
    }
    
    fseek($downloaders,0,SEEK_SET);
    ftruncate($downloaders,0);
    
    $youcantdownload = 0;
    foreach ($user as $line) {
    list($savedip,$savedtime) = explode('|',$line);
     if ($savedip == $userip) {
        if ($time < $savedtime + ($uploadtimelimit*60)) {
          $youcantdownload = 1;
    	  $downtimer = $time - $savedtime ;
    	  $counter = $uploadtimelimit*60 - $downtimer;
        }
      }
    
      if ($time < $savedtime + ($uploadtimelimit*60)) {
        fputs($downloaders,"$savedip|$savedtime\n");
      }
    }
    
    
    if($youcantdownload==1) {
    ?><center><table style="margin-top:0px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top><?
    echo "<h1><center>Upload Time Limit</center></h1>";
    	    ?><script type="text/javascript">
    
    var running = false
    var endTime = null
    var timerID = null
    var totalMinutes = <?php echo $counter;?>;
    
    function startTimer() {
        running = true
        now = new Date()
        now = now.getTime()
        endTime = now + (1000 * totalMinutes);
        showCountDown()
    }
    
    function showCountDown() {
        var now = new Date()
        now = now.getTime()
        if (endTime - now <= 0) {
           clearTimeout(timerID)
           window.location.reload()
    
        } else {
            var delta = new Date(endTime - now)
            var theMin = delta.getMinutes()
            var theSec = delta.getSeconds()
            var theTime = theMin
            theTime += ((theSec < 10) ? ":0" : ":") + theSec
            document.getElementById('SessionTimeCount').innerHTML = 'Please wait ( <font color="#FF0000">' + theTime + '</font> ) Minutes for Upload'
            if (running) {
                timerID = setTimeout("showCountDown()",1000)
            }
        }
    }
    
    window.onload=startTimer
    </script>
    
    
    <center><span id="SessionTimeCount"></span></center><br /><br /><br /><br />
     <?
    
    	    include("./bottomads.php");
    
    ?><td><tr><table><?
     include("./footer.php");
          die();
    
    }
    
    }
    
    ///////////////////////////////////////////TIMER///////////////////////
    
    
    $sizehosted = 0; //get the storage size hosted
    $handle = opendir("./storage/");
    while($file = readdir($handle)) {
    $sizehosted = $sizehosted + filesize ("./storage/".$file);
      if((is_dir("./storage/".$file.'/')) && ($file != '..')&&($file != '.'))
      {
      $sizehosted = $sizehosted + total_size("./storage/".$file.'/');
      }
    }
    $sizehosted = round($sizehosted/1024/1024,2);
    
    if(isset($allowedtypes)){ //get allowed filetypes.
      $types = implode(", ", $allowedtypes);
      $filetypes = "<b>$lang[allfile]</b> ".$types."<br /><br />";
    } else { $filetypes = ""; }
    
    if(isset($categories)){ //get categories
      $categorylist = "$lang[cat2]: <select name=\"category\">";
      foreach($categories as $category){
        $categorylist .= "<option value=\"".$category."\">".$category."</option>";
      }
      $categorylist .= "</select><br />";
    } else { $filetypes = ""; }
    
    if(isset($_GET['page']))
      $p = $_GET['page'];
    else
      $p = "0";
    include 'total.php';
    
    switch($p) {
    case "tos": include("./pages/tos.php"); break;
    case "faq": include("./pages/faq.php"); break;
    case "img": include("./pages/image.php"); break;
    default: include("./pages/upload.php"); break;
    }
    
    include("./footer.php");
    ?>
    or if you can fix problem 2

    in yellowtip 2.0 web server I need to INSTALL the gd files, it does NOT have any with it and I un ; the php_gd2.dll line (errors that its not there)

    ive tried installing every form of web software that uses http and php that I could find ranging from xampp (currently on) wamp(same problem) easyphp(connect ion always reset). AND yellowtip 2.0 (I REALLY want to use this, PLEASE assist in installing GD files.)

    Please assist as my mind is now gone.
    Last edited by LordZyse; Aug 5 '09, 11:37 AM. Reason: defining love of yellowtip
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    You've probably neglected to close a block with '}' - check your included files.

    What was the exact error message?

    Comment

    • LordZyse
      New Member
      • Aug 2009
      • 4

      #3
      Originally posted by Markus
      You've probably neglected to close a block with '}' - check your included files.

      What was the exact error message?
      its the same one with the resolution you are referring to, but as I said when I use yellow tip I get the error about the

      Fatal error: Call to undefined function: imagecreatefrom jpeg() in C:\Program Files\YellowTip \Htdocs\uploadt est\basic.php on line 49

      instead of the unexpected end line, I checed al the coding and I cant find a braket to close,

      Hense why the yellow tip just need the installation of the gd library files.

      hense why I am at such a loss.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Confused.com

        What's wrong with your XAMPP installation - it comes with GD.

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Originally posted by Markus
          Confused.com
          .
          Car insurance?

          ImLost.com




          Dan

          Comment

          • LordZyse
            New Member
            • Aug 2009
            • 4

            #6
            Originally posted by Markus
            Confused.com

            What's wrong with your XAMPP installation - it comes with GD.
            xampp, gives me the end of file error.

            Comment

            • LordZyse
              New Member
              • Aug 2009
              • 4

              #7
              ITS FIXED!!!!
              using this webpage

              downloading the previous version that yellow tip was using 4.3.6
              extracting the extension folder
              (you have to use same version of dll's as the php version)
              on the
              extensions_dir
              I HAD to put c:\program files\yellowtip/extensions/
              Had to put the / instead of the \.
              uncommented the php_gd2.dll

              AND IT WORKS!

              If you want to help me test upload a pic to http://zyse.ath.cx/uploadtest/

              Thanks for helping tho!

              Lord Zyse

              Comment

              Working...