jasonc Posted July 6, 2008 Share Posted July 6, 2008 I do not fully understand what this does and would really appreciate it if someone could let me know of a way to get the same results from the PHP5 command try() using a server with PHP4 on it. thanks in advance for your help. below is a part of the code i currently have been given, the rest of the code is not shown as this contains private 'key' info relating to access. <? //catch the exception that gets thrown if the cookie has an invalid session_key in it try { if (!$facebook->api_client->users_isAppAdded()) { $facebook->redirect($facebook->get_add_url()); } } catch (Exception $ex) { //this will clear cookies for your application and redirect them to a login prompt $facebook->set_user(null, null); $facebook->redirect($appcallbackurl); } ?> Link to comment https://forums.phpfreaks.com/topic/113456-php4-alternative-to-php5s-try/ Share on other sites More sharing options...
DarkWater Posted July 6, 2008 Share Posted July 6, 2008 There is no alternative except shaky error handling. If the Facebook API requires try/catch blocks (I'm pretty sure it does...I need to check my code and make sure...), then you need PHP 5. PHP4 reached it's end in like, December, so every host should now have PHP 5. Link to comment https://forums.phpfreaks.com/topic/113456-php4-alternative-to-php5s-try/#findComment-582982 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.