August 2008
Validate Email address in JS and RE
Submitted by heshan on Tue, 08/12/2008 - 12:48<script language="javascript">function checkEmail() {var email = document.getElementById(’emailaddress’);var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if (!filter.test(email.value)) {alert(’Please provide a valid email address’);email.focusreturn false;}}
Tags
Links
How to create and remove directory / folder in PHP
Submitted by heshan on Tue, 08/12/2008 - 11:53Remove directory$mydir = '/path/directory/images/'; // this will remove images directoryif (is_dir($mydir)) {rmdir($mydir);} else {echo $mydir.' does not exists';}Create$mydir = '/path/directory/images/
Tags
Links