grs5211 Posted June 2, 2009 Share Posted June 2, 2009 I have this code: $dir_handle = opendir($path) or die("Unable to open $path"); What I want to do is goto a javascript function if the path fails instead of just the message output. I would like to do this: $dir_handle = opendir($path) or die(execute my 'function'); Any thoughts!! Link to comment https://forums.phpfreaks.com/topic/160654-solved-execute-a-function-when-a-dieexit-occurs/ Share on other sites More sharing options...
Garethp Posted June 2, 2009 Share Posted June 2, 2009 if(!opendir($path)) { //execute function } Try that Link to comment https://forums.phpfreaks.com/topic/160654-solved-execute-a-function-when-a-dieexit-occurs/#findComment-847832 Share on other sites More sharing options...
grs5211 Posted June 2, 2009 Author Share Posted June 2, 2009 That worked well. Thanks Link to comment https://forums.phpfreaks.com/topic/160654-solved-execute-a-function-when-a-dieexit-occurs/#findComment-847847 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.