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? Quote Link to comment 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>'; } Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Barand Posted April 6, 2008 Share Posted April 6, 2008 Seconded Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.