Verifying email address

i have this code "Matching patterns" that i learned from my
book that i am studying. Apparently it makes it able for me to
check if my users have given me a valid email address. How does it
work? Have i got the proper php code ?
Here is the code i have, hope someone can help me out .
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Testing Regular Expression
Patterns</title>
</head>
<body>
<?php // Script 13.1 - test_pattern.php
// This script takes a submitted string and checks it against
a submitted pattern.
// Address error handling.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
if ( isset ($_POST['submit'])) { // Has the form been
submitted ?
if (ini_get('magic_quotes_gpc')) { // Adjust if Magic Quotes
is turned on.
$pattern = stripslashes ($_POST['pattern']);
$string = stripslashes ($_POST['string']);
} else { // Use the posted value as is.
$pattern = $_POST['pattern'];
$string = $_POST['string'];
// Trim off extraneous spaces, just in case.
$pattern = trim ($pattern);
$string = trim ($string);
// Print the results.
print "<p>The result of checking<br
/><i>$string</i><br />against<br
/><b>$pattern</b><br />is ";
if (eregi ($pattern, $string) ) {
print 'TRUE!</p>';
} else {
print 'FALSE!</p>';
} else { // Form has not been submitted.
// Set the variables to blank values.
$string = '';
$pattern = '';
// Display the HTML form.
?>
<form action="test_pattern.php" method="post">
<p>Regular Expression Pattern: <input type="text"
name="pattern" value="<?php print $pattern; ?>" size="50"
/></p>
<p>Test String: <input type="text" name="string"
value="<?php print $string; ?>" size="50" /></p>
<input type="submit" name="submit" value="Test!" />
</form>
</body>
</html>
I want to be able to verify my users email address to make
sure they gave me a valid address.
Thank you so much

TTal wrote:
> You cannot check to see if an email address is valid as
in 'in use' or not.
> You can only check to see if the pattern of letters and
numbers that the
> user has entered would constitute a valid email address
format.
Correct.
Luis, I know that you're using a book by Larry Ullman, whose
PHP books
enjoy a good reputation. However, unless you have
misunderstood the
lesson, the code that you posted is close to useless. The
only way in
which you could use it is to test a regular expression.
If you want to find a regular expression to test the script,
do a Google
search for email regular expression. It needs to be a POSIX
regular
expression, because the script uses eregi(). I suspect Larry
Ullman has
used eregi() because POSIX regular expressions are meant to
be easier
for beginners, but they're less effective, and are likely not
to be
supported by default in PHP 6.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Icloud will not back up because it says email address not verified.  I am not getting a link in my email to follow to verify account, checked email address listed is correct, so how do I verify email address when I dont get the email link?

    I am unable to verify email address to sign in to icloud so that I can backup my stuff.  I am not getting an email from apple to follow a link to verify email address.  I have checked to make sure the email address is correct in the icloud settings, but all it will tell me is to check my email for instructions on how to verify my account.  I am not getting the email!  Please help, I am able to sign in to my itunes account and buy new music all the time!  I get my itunes receipts and everything, and know the email is correct so what is the deal?

    If you have given correct info about you ios 6.1.3 - all you need to do is delete account. You will be able to sign in with new one afterwards. Make sure you don't delete any info when you see those prompts.

  • Have window on screen saying cannot backup to icloud without verified email address, i verified it in an email but the screen is looked, i have 2 choices - latter or settings, neither will work and screen is stuck there

    I turned on i cloud, recieved an email to verify email address which i did verify, but now my i pad is frozen with a window on screen saying... Can Not Back Up...This i pad cannot back up to i cloud without a verified email address. I have 2 choices...latter or settings, neither button will work

    Welcome to Apple Support Communities
    Hold Sleep and Home buttons for 10 seconds until your device restarts, so you will be able to use the device again

  • HT5538 what if the phone is having a problem verifying email address for FaceTime?

    what if the phone is having a problem verifying email address for FaceTime?

    Hey miles r.
    Thanks for the question. I understand that you are experiencing issues with FaceTime. The following resources may provide a solution:
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime or iMessage is "Unable to verify email because it is in use"
    http://support.apple.com/kb/ts3510
    Apple ID: Associating and verifying email addresses with your Apple ID
    http://support.apple.com/kb/HE68
    Thanks,
    Matt M.

  • HT1766 I can not open my ipad mini, a message says " cannot back up. This ipad can not back up to icloud without a verified email address. later , settings but neither of the two when clicked can't be opened.pls advise on what to do?

    I can not open my ipad mini, a message says " cannot back up. This ipad can not back up to icloud without a verified email address. later , settings but neither of the two when clicked can't be opened.pls advise on what to do?

    Have you tried a soft-reset ? Press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider if it appears), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Email - request to verify email address - cant get rid of this

    Still getting this popup message in the upper right of the My Verizon page.
    I clicked on Send Verification Email and I do not receive an email.  Can this be removed or stopped ?
    Is everyone else getting this annoying message? Why cant this be stopped? 
    My email has always been the same for years.  I shouldnt have to deal with this pop up.
    Action Needed: Verify Email Address
    none
    Make it easier for Verizon to communicate with you to reset your password, get important notifications, etc.
    The above Primary Email Address on file is not verified. Click the link below to send a verification email to this email address. Please follow the instructions in the email.
    Send Verification Email
    NOTE: To change your Primary Email Address on file, please visit the Profile Page.

    Checked my email (Verizon email) and no email was sent to me for email verification.  Nothing sent to inbox and nothing in my spam folder. It didnt send anything to me.   I am tired of that message popping up and that other one too about the facebook connect or whatever.  It pops up and blocks the inbox message amount.  Stupid.

  • IPad cannot backup without a verified email address--LOCKED

    Message pops up after lock screen that says:
    "iPad cannot backup without a verified email address"
    with the options of LATER and SETTINGS.  I usually select LATER button and move on.  This time it is locked up.  I tried a hard rest by pressing the home button and power/ sleep button but nothing happens. 
    I have not setup an iCloud account, and have not set up to sync with a Mac or PC. 
    Please help. 

    Thanks JimHdk,
    Can't get to the settings due to the error message.  It will not allow me to select an option. 
    I do believe that a hard reset is the answer, and i am able to go through to the black out screen, but the Apple logo is not coming up. 
    If I am unable to accmplish a hard reset today I may just have to make an appointment at the genius bar. 

  • My iPad cannot back up to iCloud without a verified email address. I can't press anything. Is it a technical problem?

    It shows my iPad cannot back up to iCloud without a verified email address. I touched Later and Settings but it's not working and I can't even switch it off or anything. What should I do?

    If your iPad is unresponsive, reset it by holding the power and home buttons until you see the Apple logo, then release.

  • My I pad shows cannot back up to Icloud without a verified email address and I cannot use my I pad to get rid of this msg.

    My I pad shows a message    Cannot Back Up   to I Cloud without a verified email address  and I cannot  slide to unlock   how do I get out of this

    Reset it by holding the power and home buttons at the time until you see the Apple logo (ignore the slide to shut down screen), then release.

  • JavaMail using SMTP to verify email address

    hi,
    does any samples to verify email address by SMTP using JavaMail ?
    Thanks in advance.
    Wilson

    I think this is as close as you can get, to validating
    an actual e-mail address,
    so more info
    "Performs a DNS lookup on a domain to find the mail exchanger (MX) record. This can be used as part of an email system, or to validate email domains. E.g. if a user enters [email protected], use the component to get the MX record for hotmail.com. If no MX records are returned, it's not a valid e-mail address. "

  • Hi i have a problem with my security question verify email address

    hi,
    i have a problem with my security question verify email address

    If Manage your Apple ID primary, rescue, alternate, and notification email addresses does not help, you can contact the Apple ID Security site from http://support.apple.com/kb/HT5699 or call the AppleCare support number from http://support.apple.com/kb/HE57 and ask to speak with the Account Security Team.

  • I accidentally have 2 apple id's and i want to put the already verified email address on the other apple id.  How do i do that?

    I accidentally have 2 apple id's and i want to put the already verified email address on the other apple id.  How do i do that?

    It's not currently possible to merge accounts, nor to transfer content from one account to another account - content will remain tied to the account that downloaded it. You should be able to log into the account and change its primary email address (to an address which is not currently on another account) : http://appleid.apple.com

  • Apple ID / iCloud - Cannot verify email address , maybe used in a different account?

    Hi all!
    Until last week I was having a Family Account on MobileMe.
    Now that I have transferred all sub accounts to iCloud I moved the main account, too.
    All sub accounts are working fine and the can use all services like Find my Friends.
    Now after having moved the main account all worked fine for that account except one service.
    When trying to use the Find my friends I get a message
    "Cannot connect to Find my Friends - Verify your Apple ID at https://appleid.apple.com to use Find my Friends"
    When opening that URL on my mac and going to "Manage your account" and then clicikng on "Verify now"
    "A verification email has been sent"
    Doing the same from the dialogue on my iPhone I get "Email address is already verified for another Apple ID"
    Having worked though a lot of discussions here I think the issue is with an old apple id that I might forgot about having my new one as an alternative address verified.
    The problem is now that I don't have access to this old account , so I cannot remove it.
    I should mention that I did not get a single mail for verification send to that address , even though having asked for it on my mac now several times.
    What I tried so far
    - Connected to all apple id accounts I have access to and assured that the eMail is not used and verifed there.
    - Tried the "Verify now" several times
    - Supplied a different alternative address to that account and succesfully veriefied it. Still I cannot verify the primary one and cannot use Find my Friends
    - Updated the password to meet new complexity rules, it does now include lower,capital letters, numbers and is at least a characters long
    That leaves me know with two questions:
    1 - How can it be, that opening the same page and doing the same thing, results in two different messages on my Mac and my iPhone?
    2 - How can I arrange, that from this old account the alternative address is removed so that I can verify it agains the new one?
    Many thanks in advance for any ideas!
    Note: This account is my main private eMail so dumping it and creatign a new iCloud account is not an option.

    I had a similar problem. I had to call Apple support via phone and ask what apple ids my email was associated with. He was able to give me the email server it was associated with (ex: yahoo, gmail, hotmail, etc) and that sparked off the memory I needed to recall that ancient and unused apple id. Then I had to recover the password, log in to that old id and change the primary email address.
    As for no verification email sent, there is a major lag between changing your settings and them actually changing in Apple's system. I don't know why this is. I couldn't delete a secondary email no matter what I tried. Then 4 hours later, it finally let me do it.
    hope this helped a litte, good luck!

  • Can't verify email address for a new apple ID

    Just created a new Apple ID and when I click the link to verify my email address at id.apple.com, the page won't display. Thank you.

    Have you tried opening the email on a different browser, and clicking the 'verify now' link on that - it's possible that the settings that you have for that browser are blocking the site.

  • Can't verify email address for receiving messages in Messages and FaceTime

    In the Preferences for Messages you can set additional email addresses that others can use when sending Messages and FaceTime messages. Apple sends a verification email to the email addresses you add. I have been able to complete this process for three out of four email addresses. Two of those I added today.
    The address I use the most, my long-time email address with my ISP Verizon, repeadedly fails in the process. First, the Preferences panel says 'Email sent'. Then it says 'Waiting to verify' with a link to Details. Apple's verification message never arrives in my Verizon mailbox.
    At one time (pre-Mavericks?) this email worked with Messages and FaceTime, it is the address I use for iTunes purchases. I have checked the Verizon email site for Spam or blocked email addresses. Nothing there.
    Any magic you can suggest?

    Hi,
    It does seem strange that the email works in one place and not another.
    Having said that I have had an email as an Apple ID in the past then the security requirements have changed and whilst it works in some places it often needs you to verify for use in a new place.
    Whilst any login to any Apple Service does check the ID and password with a central database each service is run on it's own servers.
    this leads to some almost two step issues where an ID already in use is not asked to up it's security but a new app can be almost blocked.
    If you go to https://appleid.apple.com/ and use the Manage option to login to that ID is it showing Verified there ?
    AS an Apple ID was there a a recovery email that was linked to it ?
    Do you still have access to that ?  It might be where the email was sent.
    7:34 pm      Thursday; November 6, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • Game Center - Unable to verify email address

    I bought both my boys an ipod touch 4th gen. Set up new apple ID's for gamecenter because I didnt want them under my ID since I use it for my iphone. Problem is when they try to add friends it tells us that their email is not verified. We did the verification email.
    Only thing I can think of is when we set it up there was an option to send terms & conditions to parent or guardian. I didnt click this because I was setting it up.
    Is there a way to get their ID's to work or reset gamecenter to send the terms & conditions to me, I'm thinking that is why they cannot add. All other parental controls are set accordingly allowing them to play games and add friends. Any help is appreciated.
    Thanks

    Same to me on my iPhone (German). My account email is working, but it's not the same address my friends want to add me. When I want to verify the other email address it says we sent an email to you to verify. But I didn't get any email, no matter if I repeat the process or delete the address and add it again.
    At all I think the App is not the best. When you touch a link, there is nothing which shows you that there is something in progress. You only have to wait until a new page appears. Why could this App don't use the general interface. The App is from Apple, isn't it????

Maybe you are looking for

  • Can't access ejb with more than 1 person at the same time?

    I am using the ejb to access the database using DBConnection Pool that I find in book. The code is as follow: The problem is when more than one user access almost at the same time, the one who enter frst can access, but the other one can't and return

  • Error message in ME21N and ME22N

    Dear Friends, I am facing one problem... my requirement is at the time of saving purchase order i need to check some thing and if that check fails i need to display the error message and needs to stop the creation of purchase order. That error messag

  • My external hard drive is no longer accessible

    I went looking online for more information about my LaCie external hard drive no longer working, and I found several recent posts from other LaCie owners experiencing similar issues. I have to wonder if the issue isn't related to the last firmware do

  • How to create print document for payment to customer through cash journal

    Dear Sirs, I have a problem with print document from cash journal. I enter a payment to customer (when I turn the money to customer) and the system makes right posting, but when I try to print this point, system printing document for incom from custo

  • Function module to find parent organization ID

    Dear gurus, I am searching the function module to find a parent Organization ID from Org plan base on an existing that I know.  The objective is to go up in the hierarchy t o create via BADI a header level hierarchy approval using the Org plan as sou