westminster86 Posted April 6, 2008 Share Posted April 6, 2008 im using php 4 so i can not use the try block for my exception handling. Ive got various things to check like if the form is filled out, password lengths and so forth. What can i use instead of try? Link to comment https://forums.phpfreaks.com/topic/99848-try/ Share on other sites More sharing options...
doni49 Posted April 6, 2008 Share Posted April 6, 2008 Try is for exception handling--for example if there's a server problem don't expose your mySQL code to the browser. Here's the code I use to validate my contact form--this portion checks to make sure the Name field is filled in. if (eregi ("^[[:alpha:].' -]{2,50}$", stripslashes(trim($_POST['first_name'])))) { $fn = escape_data($_POST['first_name']); } else { $fn = FALSE; $validForm = false; echo '<p><font color="red" size="+1">Please enter your first name.</font></p>'; } Link to comment https://forums.phpfreaks.com/topic/99848-try/#findComment-510669 Share on other sites More sharing options...
trq Posted April 6, 2008 Share Posted April 6, 2008 im using php 4 so i can not use the try block for my exception handling. Ive got various things to check like if the form is filled out, password lengths and so forth. What can i use instead of try? if Link to comment https://forums.phpfreaks.com/topic/99848-try/#findComment-510671 Share on other sites More sharing options...
AndyB Posted April 6, 2008 Share Posted April 6, 2008 if I nominate Thorpe for the most concise, clear, and unequivocal post of the year Link to comment https://forums.phpfreaks.com/topic/99848-try/#findComment-510863 Share on other sites More sharing options...
Barand Posted April 6, 2008 Share Posted April 6, 2008 Seconded Link to comment https://forums.phpfreaks.com/topic/99848-try/#findComment-510864 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.