Hi there, I'm using the following bit of code and get the error message: [color=red]Parse error: parse error, unexpected '{' in /xxx/file.php on line 4[/color] [code]<?php $file = "testpage.txt"; if (file_exists ($file)){ try { // The Error is occuring here if ($readfile = fopen ($file, "r")){ $curvalue = fread ($readfile,filesize($file)); $curvalue++; if (is_writable ($file)){ try { if ($writefile = fopen ($file, "w")){ fwrite ($writefile, $curvalue); echo "Wrote $curvalue to file."; } else { throw new exception ("Sorry, the file could not be opened"); } } catch (exception $e){ echo $e->getmessage(); } } else { echo "File could not be opened for writing"; } } else { throw new exception ("Sorry, the file could not be opened."); } } catch (exception $e) { echo $e->getmessage(); } } else { echo "File does not exist."; } ?>[/code] Can anyone see the problem?