a preg_match on the string. Though as we noted in a recent thread, emails are a bit tricky to detect correctly.
If it contains an e-mail address, send a test e-mail and see if the e-mail address is valid.
No way to test for validity. See next point.
If it sends successfully, do the following:
Sending successfully and actually having a mailbox on the other end are two entirely seperate conditions, and you cant really test for the second one (at least, not during the course of a page-load)
Display screen with "Check here if you would like to be added to..."
When that is selected and the user clicks okay, do this:
Send an e-mail to 2 e-mail addresses for me
Write user to mySQL database on server.
Also simple enough, as you've already sent one email, you should be able to send 2 more, and a database add is simple enough.
To start, this is what is there for the form on the home page:
<form id="emailbox" name="form1" method="post" action="email.php">
<input type="text" name="go" id="go" value="your e-mail" onclick="input_focus(this)" onblur="input_reset(this)"/>
<input type="submit" value="Join" />
I was having trouble finding a good predefined method in the php.net directories for strings to test if there is a .com, .net, .biz, .org, .info, etc. & if there is an @ in the submission- do you know of one?
See above linked thread. We give a couple of suggestions for regex in terms of emails.
I would be using a global variable, $email, which would be initialized through
, as you can see in the form markup. Then I can make a function, isItAValidEmail(), for the submission testing, then a second function for test e-mail and e-mail list joining acceptance is displayed using the echo(some HTML & their styles) function.
the words 'global' and 'variable' should be avoided together whenever possible. Pass the variable around to your functions.