Jump to content

PHP Email Form Validation


reth

Recommended Posts

Hi Everyone,

 

I was hoping that someone can help me out.  I made a form and want it to only make emails work in it (have to type [email protected].)  I am having issues with how to make it work.  The code I have so far looks like this:

 

<div id="unsubscribe">

   

    <form id="form" name="form" class="rt" method="post" action="">

        <input type="hidden" name="source" value="flash games" />

        <fieldset>

            <label for="email1">

                <span>Please enter your email address:</span>

                <input type="text" name="email1" id="email1" />

            </label>

            <button class="submitBtn" name="button" id="button" type="submit"><span>Unsubscribe</span></button>

        </fieldset>

    </form>

 

</div>

 

Please let me know if any of you know the solution.

 

Thanks,

Reth

Link to comment
https://forums.phpfreaks.com/topic/126830-php-email-form-validation/
Share on other sites

Validating e-mail addresses in PHP is a very sensitive area because there are so many incorrect ways of doing it. Here is a really good article explaining how to validate e-mails the right way.

 

Also check out this e-mail address validation script.

Archived

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

×
×
  • Create New...

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.