<?php include("include.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><title><?php print($sitename);?> - Data Reports</title></title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="css/master.css">
<script type='text/JavaScript' src='scripts/scw.js'></script>
<?php
$updating = file_exists("dbrestore.lock"); // Make sure lockfiel does not exist.
if(!$updating){
/****************************************************
* Try to connect to the database. Continue if
* successful and stop if failed.
****************************************************/
//catch an exception connecting to the database
line 19 try {
$pg = pg_connect($data_connection_string); //connect to the db
if (!$pg){ //if connection fails, throw exception
throw new exception ("There was a problem connecting to the database.");
}//end if
} catch (Exception $e){
$errors .= "\n<div class='error'>The Database could not be reached.</div>\n";
}//end try
</head>
<body>
<?php include("nav.php"); ?>
<div class="content">
<?php
if($updating){
print("<div class='info'>The database is currently being updated. This only takes a short time. Please refresh the page in about one minute.</div>");
} else {
print($errors . $form . $messages . $result_table);
}
?>
</div>
</body>
</html>
Above is the code (file name: data.php) with which i am having troubles. this code results in the error as
Parse error: syntax error, unexpected '{' in /var/www/wsn-acre/data.php on line 19
actually i move the website from the xubuntu server to debian server with apache2, php5 and postgresql. now i am facing this problem.
Please, can anyone provide me some guidance.
Thanks