FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Try method in php does not work





MWANGI
Very Happy Hello everyone

I used this code
Code:

<?
require ('functions.inc');
try{
DisplayRecordTable();
}
catch(Exception $e)(
echo $e->getMessage();
}
?>


But it does not work. Does anyone know why it gives the error message

Parse error: parse error in c:\phpdev\www\testing\dtable.php on line 3


Thanks
BlackSkad
The exceptions-mechanism is only available in php5. Most likely you have a lower version of php running on your computer...

BlackSkad
SirDuncan
hi,

<?
phpinfo();
?>

this way you will find what version of php you are using
n0obie4life
Code:
<?php
echo phpversion();
?>


Simplest code Rolling Eyes.

Frihost uses php4, so if you are trying to do that code on Frihost, it will not work.
MWANGI
I was wondering, since you are a modarator, can you be able to speak kindly to Bondings and ask him to upgrade to php 5 please.

I do not want to change the code in all my pages since they are very many and I do not want to mess everything else as I am not too comfortable with my php skills.

Is there another alternative to the try and catch method in php 4.

Please help me out here

Thanks in advance. Confused
n0obie4life
PHP5 will break lots of scripts and almost all hosts still use PHP4.

A nice debate is located here.

We won't install PHP5 as far as I know, like I mentioned, phpBB will stop working..maybe even some other stuff.

So, I'm afraid you'll have to find an alternative method to use that function in php4.
Related topics
[php] can't display rss feeds using rss2html.php
Drying clothes in the microwave
DVD Video?
A suggestion... take it as you will
PHP VS ASP
FTP and PHP
What does it take to convince yourself something ?
PHP index page not displaying problem
phpBB2 : NEED HELP
phpBB2 ERROR PLEASE HELP
Linux - Red Hat
SMTP problem
Cron Jobs Problem
Page File problem with FireFox
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.