Jump to content

Archived

This topic is now archived and is closed to further replies.

cjbeck71081

Parse error: parse error, unexpected T_CONST???

Recommended Posts

Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:\www\mapviewerphp\constants.php on line 29


see if anyone knows what its looking for, here is the code.

[code=php:0]
<?
class MgMimeType
{

/// LINE29   const Agf  = "application/agf"; /// \if INTERNAL  \endif
   /// application/octet-stream
   const Binary  = "application/octet-stream"; /// \if INTERNAL  \endif
   /// model/vnd.dwf
   const Dwf  = "model/vnd.dwf"; /// \if INTERNAL  \endif
   /// image/gif
   const Gif  = "image/gif"; /// \if INTERNAL  \endif
   /// image/jpeg
   const Jpeg  = "image/jpeg"; /// \if INTERNAL  \endif
   /// image/png
   const Png  = "image/png"; /// \if INTERNAL  \endif
   /// text/plain
   const Text  = "text/plain"; /// \if INTERNAL  \endif
   /// image/tiff
   const Tiff  = "image/tiff"; /// \if INTERNAL  \endif
   /// text/xml
   const Xml  = "text/xml"; /// \if INTERNAL  \endif
   /// text/html
   const Html  = "text/html"; /// \if INTERNAL  \endif
   
}
?>
[/code]

Thanks!

Share this post


Link to post
Share on other sites
Yea, im afraid my PHP might not be installed correctly, do you know what file that referances, so i can check to see if it exists?

Share this post


Link to post
Share on other sites
Nope im Version 5.1

www.cbeckserver.com/phpviewersample/testing.php

thats my PHP info page

i dont know what PHP application page, wants that information, but im afraid i might not have it.. In other words my PHP is working, but barely...

Thanks

Share this post


Link to post
Share on other sites
Just as i looked at that, i noticed that i was reading the 5.1 build... not the version number, i am using 4.3.2 i guess, what is your recommendation?

Share this post


Link to post
Share on other sites
[quote author=cjbeck71081 link=topic=108956.msg438917#msg438917 date=1158867041]
Just as i looked at that, i noticed that i was reading the 5.1 build... not the version number, i am using 4.3.2 i guess, what is your recommendation?
[/quote]

well, seeing that PHP 4 is finicky when it comes to OOP in some cases, really your best bet is to simply come up with a naming convention for your const vars and define them within your constructor:
[code]
<?php
class MgMimeType {
  var $BINARY;
  var $DWF;
  var $GIF;
  var $JPEG;

  // then, initiate values for them within your constructor
  function MgMimeType() {
    $this->BINARY = "application/octet-stream";
    $this->DWF = "model/vnd.dwf";
    $this->GIF = "image/gif";
    $this->JPEG = "image/jpeg";
  }
}
?>
[/code]

hope this helps

Share this post


Link to post
Share on other sites
I actually started to install PHP5.1 a few minutes ago.  I figured it was the easiest way to fix the problem... Turns out i get a new error.


Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual page for CGI security.

For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.


I think its a setting in the PHP.ini file, have u ever seen this before?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.