RSS

Remote Email Address Validator

2 Comments | This entry was posted on Jan 11 2009

Hello,

Long time no post! I've been concentrating on my other projects lately so I have neglected to post on here :(
However I come back with a nice little email validator :)

Email addresses are changing all the time, and some people use shifty techniques to get around email validators. This means that a website owner has to update the regular expression code on all of their websites. However if the checking was done remotely, then there'd be no need to change it on all. You'd just have to change it at one place.

This is easy to implement into any website and I will provide it free for all :)

<?php
$_emailtocheck = "some@domain.com";
$_emailvalidationresult = file_get_contents("http://www.papaface.com/emailchecker/checker.php?email=".$_emailtocheck); // 0 = invalid 1 = valid
if      (trim($_emailvalidationresult) == "1")
        echo "Valid.";
else
        echo "Invalid email address.";
?>
 

The trim($_emailvalidationresult) will equal either 1 or 0. Zero if the address is invalid, and 1 if the address is correct and can receive emails.

Let me know what you think :)


[Slashdot]
[Digg]
[Reddit]
[del.icio.us]
[Facebook]
[Technorati]
[Google]
[StumbleUpon]

Copy to clipboard using javascript

0 Comments | This entry was posted on Jan 08 2009

In a current project i am working on, I need to be able to copy some posted content to my clipboard. Well I looked for a solution so I thought I’d show you….

<span style="#800000;"><span id="texttobecopied"  STYLE="height:150;width:162;background-color:pink">
This text will be copied onto the clipboard when you click the button below. Try it!
</SPAN> </span>
<span style="#800000;"><TEXTAREA ID="holdtext" STYLE="display:none;">
</TEXTAREA>
<BUTTON onClick="ClipBoard();">Copy to Clipboard</BUTTON></span>

We have a button here and a span that contains text that will be copied. The button is calling “ClipBoard();” . This is a function that we have written in javascript. It is below…

<code><SCRIPT LANGUAGE="JavaScript"></code>

function ClipBoard()
{
holdtext.innerText = texttobecopied.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("Copy");
}

</SCRIPT>

This script reads the inner text of the span, we defined the span on the first line of the function…

<span style="#800000;"> holdtext.innerText = texttobecopied.innerText;</span>

and then holds it in the computers memory. You can assign when clicking an image to copy text or other data by just adding

<span style="#800000;">onclick="ClipBoard();"</span>

To any Link,Image, script ect…


[Slashdot]
[Digg]
[Reddit]
[del.icio.us]
[Facebook]
[Technorati]
[Google]
[StumbleUpon]