Sunday, September 6, 2009

CHECK E-MAIL ADDRESS DELIVERY STATUS USING PHP

(THIS SCRIPT CHECK WHETHER THE DOMAIN NAME OF THE EMAIL ID IS EXISTING OR NOT.BUT IT WILL NOT CHECK THE EMAIL ADDRESS IS DELIVERABLE OR NOT )


hi everyone i checked this script version of php5.3. lower version of php may not support this script but you check it.

CHERAN@EXAMPLE.COM

CHERAN(USERNAME);

EXAMPLE.COM(DOMAIN NAME)
E-mail addresses, such as cheran@example.com, have two parts. The part before the @ sign is the local-part of the address, often the username of the recipient (cheran), and the part after the @ sign is the domain which is a hostname to which the e-mail message will be sent (example.com).


THE CODE:


<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method='post'>

<table border='0'>

<tr>

<td>Email</td>

<td><input name='email' type='text' value="<?php if(isset($_REQUEST['email'])){ echo $_REQUEST['email']; } else { } ?>" id='email' /></td>

</tr>

<tr>

<td>&nbsp;</td>

<td><input type='submit' name='Submit' value='Validate' /></td>

</tr>

</table>

</form>

<?php

if(isset($_POST['email'])) {

//check with out function



$email = $_POST['email'];


print("Checking: $email<br>");


if (preg_match ("/^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$/", $email)) {


print("Format Test: PASSED<br>");

print("Online host verification Test...<br><br>");

print("MX Records for: $email<br>");



list($alias, $domain) = explode("@", $email);



if (checkdnsrr($domain, "MX")) {



getmxrr($domain, $mxhosts);



foreach($mxhosts as $mxKey => $mxValue){

print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$mxValue<br>");

}



print("Online host verification Test: PASSED<br><br>");

print("Email Status: VALID");



} else {



print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No records found.<br>");

print("Online host verification Test: FAILED<br><br>");

print("Email Status: INVALID");



}


} else {


print("Format Test: FAILED<br><br>");

print("Invalid email address provided.<br><br>");

print("Email Status: INVALID");



}

}


?>



SCREEN SHOT

deliverable domain email address


click the image to enlarge

Not Deliverable domain name email address

Sunday, July 26, 2009

Ajax File Upload

You might have seen Ajax File Uploading in some sites. The basic idea is to upload a file without refreshing the page. Some sites go even further by providing details on how much percentage is uploaded, etc. It is very easy to achieve this effect using javascript.

ajax file upload example

LightLoader Track Multiple File Uploads Using AJAX With Progress Bar

view live demo and download the souce code

Saturday, July 25, 2009

AJAX file upload

view tutorial

Ajax upload

Browsers force us to use file inputs () for uploads, which are impossible to style. Moreover, form-based uploads look obsolete in modern AJAX applications. We can use flash to solve this problem, but JavaScript works nice too.
AJAX Upload allows you to easily upload multiple files without refreshing the page and use any element to show file selection window. It works in all major browsers and starting from version 2.0 doesn’t require any library to run (although it will use some jQuery functions if it’s already loaded on the page). AJAX Upload doesn’t pollute the global namespace, so it’s compatible with jQuery, Prototypejs, Mootools, and other JavaScript libraries

live demo and download