cjbeck71081 Posted September 21, 2006 Share Posted September 21, 2006 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 29see 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! Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted September 21, 2006 Share Posted September 21, 2006 Works fine for me. Is that the only code you got? Quote Link to comment Share on other sites More sharing options...
cjbeck71081 Posted September 21, 2006 Author Share Posted September 21, 2006 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? Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted September 21, 2006 Share Posted September 21, 2006 Ahhh... you must be using PHP4... const is for PHP5 only. Quote Link to comment Share on other sites More sharing options...
cjbeck71081 Posted September 21, 2006 Author Share Posted September 21, 2006 Nope im Version 5.1www.cbeckserver.com/phpviewersample/testing.phpthats my PHP info pagei 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 Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted September 21, 2006 Share Posted September 21, 2006 "PHP Version 4.3.2" at the very top ;) Quote Link to comment Share on other sites More sharing options...
cjbeck71081 Posted September 21, 2006 Author Share Posted September 21, 2006 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 Link to comment Share on other sites More sharing options...
obsidian Posted September 21, 2006 Share Posted September 21, 2006 [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]<?phpclass 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 Quote Link to comment Share on other sites More sharing options...
cjbeck71081 Posted September 21, 2006 Author Share Posted September 21, 2006 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.