Jump to content

Archived

This topic is now archived and is closed to further replies.

putnamehere

Comment Script

Recommended Posts

Hi, i'm makeing a comment script and i have a input box for the persons name or email.
Problem is when the page is submited i need to know if it's a email or website so i use the mailto:// or http:// acordingly.

How would i do this?

Share this post


Link to post
Share on other sites
Look for an '@'

[code]if (strpos($_POST['fieldname'], '@') !== false) {

       // email
}
else {

        // web site
}[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.