473,396 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.  
  4. include("./config.php");
  5. include("./header.php");
  6.  
  7. $userip=$_SERVER['REMOTE_ADDR'];
  8. $time=time();
  9.  
  10. ///////////////////////////////////////////TIMER////////////////////////////////////
  11.  
  12. if(file_exists("./uploader/".$userip.".mfh"))
  13. {
  14.  
  15. $downloaders = fopen("./uploader/".$userip.".mfh","r+");
  16. flock($downloaders,2);
  17.  
  18. while (!feof($downloaders)) {
  19.   $user[] = chop(fgets($downloaders,65536));
  20. }
  21.  
  22. fseek($downloaders,0,SEEK_SET);
  23. ftruncate($downloaders,0);
  24.  
  25. $youcantdownload = 0;
  26. foreach ($user as $line) {
  27. list($savedip,$savedtime) = explode('|',$line);
  28.  if ($savedip == $userip) {
  29.     if ($time < $savedtime + ($uploadtimelimit*60)) {
  30.       $youcantdownload = 1;
  31.       $downtimer = $time - $savedtime ;
  32.       $counter = $uploadtimelimit*60 - $downtimer;
  33.     }
  34.   }
  35.  
  36.   if ($time < $savedtime + ($uploadtimelimit*60)) {
  37.     fputs($downloaders,"$savedip|$savedtime\n");
  38.   }
  39. }
  40.  
  41.  
  42. if($youcantdownload==1) {
  43. ?><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><?
  44. echo "<h1><center>Upload Time Limit</center></h1>";
  45.         ?><script type="text/javascript">
  46.  
  47. var running = false
  48. var endTime = null
  49. var timerID = null
  50. var totalMinutes = <?php echo $counter;?>;
  51.  
  52. function startTimer() {
  53.     running = true
  54.     now = new Date()
  55.     now = now.getTime()
  56.     endTime = now + (1000 * totalMinutes);
  57.     showCountDown()
  58. }
  59.  
  60. function showCountDown() {
  61.     var now = new Date()
  62.     now = now.getTime()
  63.     if (endTime - now <= 0) {
  64.        clearTimeout(timerID)
  65.        window.location.reload()
  66.  
  67.     } else {
  68.         var delta = new Date(endTime - now)
  69.         var theMin = delta.getMinutes()
  70.         var theSec = delta.getSeconds()
  71.         var theTime = theMin
  72.         theTime += ((theSec < 10) ? ":0" : ":") + theSec
  73.         document.getElementById('SessionTimeCount').innerHTML = 'Please wait ( <font color="#FF0000">' + theTime + '</font> ) Minutes for Upload'
  74.         if (running) {
  75.             timerID = setTimeout("showCountDown()",1000)
  76.         }
  77.     }
  78. }
  79.  
  80. window.onload=startTimer
  81. </script>
  82.  
  83.  
  84. <center><span id="SessionTimeCount"></span></center><br /><br /><br /><br />
  85.  <?
  86.  
  87.         include("./bottomads.php");
  88.  
  89. ?><td><tr><table><?
  90.  include("./footer.php");
  91.       die();
  92.  
  93. }
  94.  
  95. }
  96.  
  97. ///////////////////////////////////////////TIMER///////////////////////
  98.  
  99.  
  100. $sizehosted = 0; //get the storage size hosted
  101. $handle = opendir("./storage/");
  102. while($file = readdir($handle)) {
  103. $sizehosted = $sizehosted + filesize ("./storage/".$file);
  104.   if((is_dir("./storage/".$file.'/')) && ($file != '..')&&($file != '.'))
  105.   {
  106.   $sizehosted = $sizehosted + total_size("./storage/".$file.'/');
  107.   }
  108. }
  109. $sizehosted = round($sizehosted/1024/1024,2);
  110.  
  111. if(isset($allowedtypes)){ //get allowed filetypes.
  112.   $types = implode(", ", $allowedtypes);
  113.   $filetypes = "<b>$lang[allfile]</b> ".$types."<br /><br />";
  114. } else { $filetypes = ""; }
  115.  
  116. if(isset($categories)){ //get categories
  117.   $categorylist = "$lang[cat2]: <select name=\"category\">";
  118.   foreach($categories as $category){
  119.     $categorylist .= "<option value=\"".$category."\">".$category."</option>";
  120.   }
  121.   $categorylist .= "</select><br />";
  122. } else { $filetypes = ""; }
  123.  
  124. if(isset($_GET['page']))
  125.   $p = $_GET['page'];
  126. else
  127.   $p = "0";
  128. include 'total.php';
  129.  
  130. switch($p) {
  131. case "tos": include("./pages/tos.php"); break;
  132. case "faq": include("./pages/faq.php"); break;
  133. case "img": include("./pages/image.php"); break;
  134. default: include("./pages/upload.php"); break;
  135. }
  136.  
  137. include("./footer.php");
  138. ?>
  139.  
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(connection 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.
Aug 5 '09 #1
6 1776
Markus
6,050 Expert 4TB
You've probably neglected to close a block with '}' - check your included files.

What was the exact error message?
Aug 5 '09 #2
@Markus
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: imagecreatefromjpeg() in C:\Program Files\YellowTip\Htdocs\uploadtest\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.
Aug 5 '09 #3
Markus
6,050 Expert 4TB
Confused.com

What's wrong with your XAMPP installation - it comes with GD.
Aug 5 '09 #4
dlite922
1,584 Expert 1GB
@Markus
Car insurance?

ImLost.com




Dan
Aug 5 '09 #5
@Markus
xampp, gives me the end of file error.
Aug 5 '09 #6
ITS FIXED!!!!
using this webpage
http://museum.php.net/win32/
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
Aug 6 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Andrew | last post by:
Last night I was reading about implementing my own stack. The example given pushes items on and off the stack at the start and end of each procedure (ie. in a std module). What's not so clear is...
1
by: torbs | last post by:
I am trying to use the methods in quicktimes plugin, but IE generetes an error. I have tried to use the "document.all" instead of getElementById but the results remain the same. It won't recognise...
5
by: Mike Owen | last post by:
Hi, I have just used the import Wizard to import a VS 2003 app to VS 2005. I have a lot of work to do to enable it to compile successfully with all the errors and warnings it gave me, but as a...
19
by: MLH | last post by:
I call the following Sub and Function in frmLaunch's OnOpen event code. I keep getting Property Not Found error for the AllowBypassKey setting. Failure point is line #30 in the Function (not the...
4
by: Al Williams | last post by:
Hi, I have error handling in place throughout my application. I also start the application wrapped in error handling code to catch any unexpected exceptions (i.e. exceptions that occur where I...
4
by: Rob Richardson | last post by:
Greetings! I am working on an application that targets a Pocket PC running Windows CE and SQL Server CE. Almost all functions in the application use a Try block with a Catch block that looks...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
7
by: Jan | last post by:
Hi: When I searched the newsgroup for this problem, I saw two or three instances of the question being asked, but it was never answered. Not too promising, but here goes: I have a form with...
1
by: Adrienne Boswell | last post by:
This is the strangest thing. On my local beta server (WinXP Pro SP3, PHP 5.2.3), I am getting an unexpected $end. On the production server, I am not. The files are identical. Just for shits and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.