Jump to content

Parse error: parse error, unexpected T_CONST???


cjbeck71081

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!
Link to comment
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
Link to comment
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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.