Jump to content


Photo

Comment Script


  • Please log in to reply
1 reply to this topic

#1 putnamehere

putnamehere
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 08 April 2006 - 04:41 PM

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?

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 08 April 2006 - 06:26 PM

Look for an '@'

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

       // email
}
else {

        // web site
}

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users