How to make a confirmation email to make sure the address is valid
02-17-2010, 05:05 PM
|
How to make a confirmation email to make sure the address is valid
|
Posts: 51
Name: N
|
Hi,
I would like make a PHP page containing Name and Email fields which when the user submits it sends them a confirmation email from the Email field telling them to go to a second page where they will have to fill out more information. The second page remembers the previous set of fields which will become read-only which the user entered before, then when the user is finished entered on the second page they can finally send an email by pressing the submit button.
I hope I have made it as clear as possible.
Your help will be really appreciated,
Thanks
|
|
|
|
02-17-2010, 05:15 PM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
02-17-2010, 06:44 PM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 335
Name: Jerry
|
what coding have you gotten so far? Post it then we can help you
the key is to use SQL to store the first page then bring the info back up with a key
|
|
|
|
02-18-2010, 03:26 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 51
Name: N
|
Thanks for yoru reply guys.
The code is not anything special but just a page with textboxes, drop downs and a check box with no validation controls yet:
Code:
<h1 class="divcontent"> By Email </h1>
<p class="divcontent">Please fill in the following information in order to Contact us about our consulting programmes or any other queries you many have.</p>
<form action="mail (2).php>" method="post">
<table width="799" border="0">
<tr>
<td><p>First name</p></td>
<td><label>
<input type="text" name="Firstname" id="Firstname">
</label></td>
</tr>
<tr>
<td width="164"><p>Surname</p></td>
<td width="625"><label>
<input type="text" name="Surname" id="Surname">
</label></td>
</tr>
<tr>
<td><p>Email Address</p></td>
<td><label>
<input type="text" name="Email" id="Email">
</label></td>
</tr>
<tr>
<td><p>Company name</p></td>
<td><label>
<input type="text" name="Company" id="Company">
</label></td>
</tr>
<tr>
<td><p>Number of employees</p></td>
<td>
<select name="employee" id="employee2">
<option value="please_select">Please select</option>
<option value="employee">1-10</option>
<option value="employee">10-20</option>
<option value="employee">20-40</option>
<option value="employee">40-80</option>
<option value="employee">80-160</option>
<option value="employee">160-320</option>
<option value="employee">320-640</option>
<option value="employee">Over 1000</option>
</select>
</td>
</tr>
<tr>
<td><p>Consulting type</p></td>
<td>
<select name="consultingtype" id="consultingtype2">
<option value="please_select" selected>Please select</option>
<option value="consultingtype">Financial Support</option>
<option value="consultingtype">Marketing Support</option>
</select>
</td>
</tr>
<tr>
<td height="133"><p>Message</p></td>
<td valign="top">
<textarea name="message" id="message" cols="45" rows="10"></textarea>
</td>
</tr>
<tr>
<td valign="top"><p> I agree to LMGR <a href="../Policies/policies.html" target="_blank">Terms and Conditons </a></p>
</td>
<td valign="top">
<input name="checkbox" type="checkbox" id="checkbox" value="selected">
</td>
</tr>
</table>
<input name="submit" type="submit" id="submit" value="Submit" />
</form>
Yes I thought about the idea of a database and like it, however it cannot be MySQL, it has to SQL server because I am using ASP.net for the members area and the MS SQL server database contains my user name and passwords data and it will cost me even more to have a MySQL database.
I could set up a table in my original database called "Enquires" which the PHP could connect to, if this helps.
Thanks
|
|
|
|
02-18-2010, 03:35 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 1,618
Location: UK
|
The way i do it is:
Whne teh user registers ( And your PHP script updates a users database ) I also have it insert a random auth code into the user row.
I then EMAIL that user the auth code and a link to another PHP page.
When they visit that page and enter the auth code, the php then updates the database and marks the user with that authcode as active.
|
|
|
|
02-18-2010, 03:57 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 51
Name: N
|
Thanks for your quick replies
I am not setting up a member registration page, I have already set up all of that in an ASP.net application.
All I am making is a contact us page where when the user submits instead of sending the information to me straight away, it will send a note back to the email the user entered and will link them a webpage where the email can be sent to me.
All of this is to stop somebody entered a rubbish email like below which I received from my previous websites and force them to enter an email address that actually use:
ajkldfjasdlf@ajsdfk.com
Thanks again for the responses
|
|
|
|
02-18-2010, 04:52 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
Unless you make every body who uses the contact form verify their email address.
You can't
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
02-18-2010, 06:30 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 51
Name: N
|
Yes, I would like everybody who uses the contact form to verify their address via the confirmation email they receive when they submit. But I don't know how to do this so please can somebody help me.
Thanks
Last edited by njccbeach9; 02-18-2010 at 06:31 AM..
|
|
|
|
02-18-2010, 06:36 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
As it says in the page I linked to
Quote:
1. Enter your details in a web form
2. Submit the form to the web site
3. Wait for confirmation email
4. follow instructions in confirmation email, usually a link to click
5. Log in to site with confirmed login and password
|
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
02-18-2010, 07:21 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 51
Name: N
|
The confirmation email is not part of a user registration setup. I'll outline what I am asking for more clearly:
------------------------
On Contact Us page:
Step 1/3
First Name _________TEXTBOX
Surname____________TEXTBOX
Email_______________TEXTBOX
Company name________________TEXTBOX
Number of Employees________________DROP DOWN
TYPE _____________________DROPDOWN
MESSAGE________________ TEXT AREA
I AGREE TO THE POLICES _____________________CHECKBOX
SUBMIT BUTTON
When user clicks SUBMIT BUTTON it sends an email to the address the user just entered above saying:
(No email has yet been sent to me, the website administrator)
----------------------
In Confirmation Email:
Thanks for contacting us...
See this link:
________RANDOMLY GENERATED LINK
----------------------------
When RANDOMLY GENERATED LINK is clicked:
Step 2/3- Almost done...
Confirm these details:
First Name
Surname
Email
Company name
Number of Employees
TYPE
MESSAGE
I AGREE TO THE POLICES
(all of these text boxes, drop down, checkboxes are read-only and cannot be edited by the user)
If these details are incorrect you must restart the whole process by clicking HERE (link back to Contact Us page to return to Step 1)
SUBMIT BUTTON- When clicked the message can finally be sent to me.
-----------------------------
Result page
Step 3/3
[If success]
Thank you for contacting us, we will contact you within 24 hours
Email has successfully sent
[If failed]
We're sorry but the message has failed to send, please return to your confirmation email and try again. If it continues to fail please call instead contact us by phone and alert the issue to them as well as your query:
PHONE NUMBER
--------------------------------------
I hope this has clarified things.
Thanks
Last edited by njccbeach9; 02-18-2010 at 07:25 AM..
|
|
|
|
02-18-2010, 07:58 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
Ok maybe I look at things differently (being a programmer).
user visits contact page, fills in their email address and message, submits form.
Data is stored in a database table (along with recipient email) AND the session ID.
System posts a message back to the page with "Thanks an email has been sent to your address, please click the confirmation blah blah blah".
Email is sent to user with a confirmation link uri-of-confirmation-page?id=sessionID-from-database.
Page verifies the email address and that the ID matches the one stored and fires off the stored email, flags the user as verified, sends a "thank you" email and all is right with the world.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
02-18-2010, 08:11 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 51
Name: N
|
Yes, it sounds like you got it. I know, it is hard to get your head around.
It really sounds good but there are two problems:
- I have a Microsoft SQL Express Database as I am working with ASP.net projects, so is it possible if we are going to use a database to connect PHP to MS SQL Express?
- I want to keep the database as small as possible so if hundreds of users contact us which might happen because we get £30 free google adwords and £30 free bing search when we subscribe to this hosting company. Plus I am only allowed 1 Database either MS SQL or My SQL which is 150mb maximum, I have to upgrade if I want 3 which will almost cost me double (4.99 a month to 8.99 a month).
Thank you very much,
|
|
|
|
02-18-2010, 08:19 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
http://php.net/manual/en/book.mssql.php
Quote:
|
Plus I am only allowed 1 Database either MS SQL or My SQL
|
Why do you need more than 1 ??
A single database can hold thousands of tables.
and to keep the size down, delete the message data once it has been sent.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
02-18-2010, 10:05 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 80
Name: John
Location: Sacramento
|
While the best methods have already been outlined, you could also (while less perfect) simply email a direct link to the "real" contact form and forget the rest. Something like:
Form #1 - Enter Email & Submit.
Response - URL to actual form emailed.
Form #2 - Actual Contact Form (Not linked to or indexed and an unusual URL).
I suppose you could even use an array of predetermined auth keys to lessen the chance of stumble upon contacts. Example:
Send one of these keys with the response to form #1:
$stumblekey[] = 'R@ND0MnuMB3rs@nDCharcht3RS';
$stumblekey[] = 'wewND0MnuMB3rs@n12wecht2RS';
$stumblekey[] = '34NdsMnuMB3rs@wsharcht1RS';
$stumblekey[] = 'b@ND0MnuMB3rs@neGFrrcht3RS';
urltoactualform.php?auth=<?= $stumblekey[rand(0,(count($stumblekey) - 1))] ?>
Then check upon submission of form #2:
$ok = in_array($_GET['auth'], $stumblekey);
Although I must say this would be the "duct tape" method, it might work?
|
|
|
|
02-18-2010, 10:08 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 80
Name: John
Location: Sacramento
|
Or you could simply make the reply-to for your automated response your real contact info, and instruct the recipient to simply reply?
This would be the scotch-tape technique.
|
|
|
|
02-18-2010, 10:12 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
Quote:
Originally Posted by Envision_frodo
Or you could simply make the reply-to for your automated response your real contact info, and instruct the recipient to simply reply?
This would be the scotch-tape technique.
|
Would that be so you could send your email address immediately to the spammers!
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
02-18-2010, 10:23 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 80
Name: John
Location: Sacramento
|
I thought the point was to merely ensure that a valid email was used, not avoid the ever present spamming plague. Also, I've never had a spammer post a working email to one of my forms?
Last edited by Envision_frodo; 02-18-2010 at 10:27 AM..
Reason: Appended Surprise
|
|
|
|
02-18-2010, 10:31 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 51
Name: N
|
I already have already have a MS SQL database set up which is used as a members area. (see attachment)
In order to do the database method, the PHP has to connect to Microsoft SQL server instead of MySQL. I can add a new table containing new ids which correspond to the contact us page.
How secure the key method Envision Frodo suggested? I really am not that experienced in PHP at all.
Is it possible for a user to bypass the first stage so they don't have to confirm their email address and go straight onto the real contact us page by typing it into their address bar?
Thanks your replies are really appreciated.
|
|
|
|
02-18-2010, 10:39 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
Quote:
Originally Posted by Envision_frodo
I thought the point was to merely ensure that a valid email was used, not avoid the ever present spamming plague. Also, I've never had a spammer post a working email to one of my forms?
|
So HOW would you avoid spam If you sent your email address straight out to a temporary gmail/hotmail/yahoo! address that has been specifically set up for response collection?
The ONLY way is to use a database and dual confirmation that the request/contact was genuine
It's not 100%, as every forum/newsletter/mailing list admin knows, but it helps.
Every week I delete several 12536749895000@gmail.com type "members" that haven't confirmed, the email address that "sends" the confirmation doesn't actually have a mailbox so just bounces when their harvester tries to send junk to it.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
02-18-2010, 10:58 AM
|
Re: How to make a confirmation email to make sure the address is valid
|
Posts: 80
Name: John
Location: Sacramento
|
Quote:
Originally Posted by chrishirst
So HOW would you avoid spam ...
Every week I delete several 12536749895000@gmail.com type "members" that haven't confirmed...
|
By not using the aptly described "scotch-tape" method; & sorry to hear about your spammer woes.
|
|
|
|
|
« Reply to How to make a confirmation email to make sure the address is valid
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|