Canadian Webhosting Forums Forum Index Canadian Webhosting Forums
Discussion Forums
 
 FAQFAQ   SearchSearch      RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PHP help

 
Post new topic   Reply to topic    Canadian Webhosting Forums Forum Index -> PHP
Author Message
Riffage



Joined: 27 Feb 2006
Posts: 1

PostPosted: Mon Feb 27, 2006 3:43 pm    Post subject: PHP help Reply with quote

Ive just ported my entire PHP project from my university webserver to my canadian hosting and the following code is causing an error.

Its a try throw catch paradigm basically. and when ran it gives the error that

"Parse error: parse error, unexpected '{' on line 14".

Line 14 is the 'try {'.

Whats going on? its an exact code copy from university and it doesnt run on my hosting.

Please help.
Thankyou

CODE SNIPPET IN QUESTION BELOW

try {
if (!isset($_REQUEST["ISBN"]))
throw new Exception("",MALFORMED_ISBN);

$bookDB = new BookGateway();
$Booktemplate = $bookDB->getBook(intval($_REQUEST["ISBN"]));
include_once("templates/Booktemplate.html");

}
catch (Exception $e)
{
switch ($e->getCode())
{
case NO_CONNECTION:
$Exception["MSG"] = "<p>Could not create a database connection<p>". "<h2>Error Message</h2>". $e->getMessage();
include_once("templates/Exception.html");
break;

case MALFORMED_ISBN:
$Exception["MSG"] = "<p>Error in syntax<p>". $e->getMessage();
include_once("templates/Exception.html");
break;
case QUERY_FAILED:
$Exception["MSG"] = "The last query failed with error message".$e->getMessage();
include_once("templates/Exception.html");
break;
case NO_RESULTS:
$Exception["MSG"] = "Sorry there is no record with ISBN value {$_REQUEST['ISBN']} in the database";
include_once("templates/Exception.html");
break;
}
}
Back to top
shivin
Guest





PostPosted: Mon Oct 02, 2006 12:26 am    Post subject: Reply with quote

Please post in a support ticket with enough information to replicate the error on our end.
We will have a php programmer to look into it.
Please note that debugging/building codes are chargeable in a hourly basis.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Canadian Webhosting Forums Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 


Hosting Plans :: Flash Tutorials :: Contact Us :: Privacy Policy


Powered by phpBB, MySQL and PHP