Jump to another part of the php-file
Posted: Sat Dec 20, 2003 5:11 pm
Is there any way to jump to another part in the PHP-file?
like in Visual Basic, u can have this code:
Is this possible in PHP?
becuase i've created a function that opens a file, reads from it, and the closes it etc.
But if there is an error;
It should goto another part of the script.
like in Visual Basic, u can have this code:
Code: Select all
On error goto errhandler 'On error goto errhandler
goto part 'Goto part
Exit Sub
part:
'This is were something will be done
Exit sub
errhandler:
msgbox "Error.....bla bla bla"
Exit Subbecuase i've created a function that opens a file, reads from it, and the closes it etc.
But if there is an error;
Code: Select all
<?php
@fwrite ($fp, $newcontent) or [*inputsomething here*];
?>