[Pro] How to create verifying e-mail address option?

Dear people,
I am using the PHP Form Action. Client wants me to make 2 fields for email address and yes… the 2nd one needs to verify the first one (useless… I always copy them anyways… :slight_smile: Anyway, as u know, we follow the clients wishes (!?) . Any solution for this?

Thanks!

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you’re using the PHP Form Action (not the PHP Feedback Form Action) then you are also writing your own handler. If that’s the case, then simply name the first field email_1 and the second one email_2. In your validation logic, test them for equality:

if($_POST['email_1'] != $_POST['email_2']){
    $errors['email'] = 'E-mail addresses did not match!';
}

or something like that.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi,

Version 1.85 of the PHP easiForm Actions can do this:
http://www.actionsforge.com/actions/view/55-php-easiform

If you want to add a confirmation email field with easiForm then you do this simple 2 step process along with setting up the rest of the form

  1. Add a field under the email field then in the actions window for PHP easiForm name it as: email_confirm

  2. In the ‘Required names’ field of the actions window then simple add the field name after the email field name, so the ‘Required names’ for the use of the email and email_confirm fields would be as follows: email,email_confirm

Remember the names used as element names and then in the action window fields are case sensitive, so the email field must be called email and the email confirm field must be called email_confirm, not Email, EMAIL, email confirm nor Email_confirm

HTH


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 5 Mar 2009, 1:54 pm, waltd wrote:

If you’re using the PHP Form Action (not the PHP Feedback Form Action) then you are also writing your own handler. If that’s the case, then simply name the first field email_1 and the second one email_2. In your validation logic, test them for equality:

if($_POST['email_1'] != $_POST['email_2']){
    $errors['email'] = 'E-mail addresses did not match!';
}

or something like that.

Walter

I am sorry… It is indeed the PHP Feedback Form Walter… I didn’t realize that there was another one as well…

I am happy to try your suggestion Mike, but it took me hours to make this extended form. It would mean I have to start all over again… :frowning:
I would rather choose or another solution?!

So, is it possible than in the PHP feedback action?

Thanks!

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 5 Mar 2009, 9:39 pm, paulvw wrote:

I am happy to try your suggestion Mike, but it took me hours to make this extended form. It would mean I have to start all over again… :frowning:
I would rather choose or another solution?!

Well you wouldn’t need to start again but if you are happy with the way you are doing the form then that’s fine, I was only offering the suggestion that this is possible with PHP easiForm actions if you wanted to go that way.

If you decide to give the PHP easiForm actions a go there is a tutorial here:
http://www.easibase.com/freeway/freeway_form.php

The above tutorial doesn’t cover the email confirm but that is simply a case of adding another field below the email field, naming it email_confirm, adding that name to the ‘Required names’ field in the PHP easiForm window.

You will need to be on an ioncube friendly server so if you wanted to give the actions a go just check with your hosting company first that they are ioncube friendly, I have found very few who are not but they do exist, anyway you can try the actions before you buy… while the action you are currently using is free.

HTH


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Mike, besides verifying, can your action also handle issues as described in this thread? http://www.freewaytalk.net/thread/view/47458

In that case I would be interested in the action, since it will kill two birds in one stone, since I am talking about the same website and two forms.

Thanks!

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Paul,

Currently easiForm does not have any way to implement what was talked about in the referenced thread but as you are aware there is now the option for an email confirmation field.

I did see the thread you talk about, as I was doing some work in the PHP easiForm action to use with another ‘not released’ PHP easiQuery MySQL acton… so I thought about integrating this but in all honesty it is not that simple… in that the action cannot read the ‘Freeway’ users mind as to what the element or elements would be or the values that trigger which of any other emails to use. I have been trying to think of a simple ‘and non action cluttering’ way of doing that but haven’t found anything that is elegant (or as elegant as the non elegance of the easiForm action)… still trying to come up with some way to do that though.

What exactly would you * like * offer your user for this, a menu selection of various options or would it depend on a configuration of various elements?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Mike.
What the client (I think we made it simpler after talking to him…) wants is a choice of three different email addresses to send the for too. So in the form people can check certain options (a standard procedure) but then choose to whom they send the form (three different departments).
It sounds so easy, but is it?

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Make a picking list called ‘to’ with the names of the addressees as
labels and the numbers 0 - 2 as the values. In Freeway, this should
look like this in the Output tab of the Inspector:

Choice Value
Bob 0
Carol 1
Ted 2

Then at the top of your form handler PHP code, add an array of the e-
mail addresses:

<?php
$send_to =  
array('bob(at)domain.org','carol(at)domain.org','ted(at)domain.org');
?>

Then, in your form handler code, where you see the Mail() function
invoked, change the first argument (the variable passed to the
function) from whatever it is currently to this:

$send_to[$_POST['to']]

The final thing will look like this (similar, anyway):

mail($send_to[$_POST['to']],$subject,$message,$headers,$flags);

Walter

On Mar 13, 2009, at 7:24 PM, paulvw wrote:

Thanks Mike.
What the client (I think we made it simpler after talking to him…)
wants is a choice of three different email addresses to send the for
too. So in the form people can check certain options (a standard
procedure) but then choose to whom they send the form (three
different departments).
It sounds so easy, but is it?

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, are you saying that this can be done than with the PHP Feedback Form? Which I have at the moment?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I just downloaded this Action and gave it a try, and by dint of looking at the published code, figured out a way to do this without editing or disabling or uploading anything. To follow along, you will need a good text editor. If you’re feeling spendy, I love me some TextMate from http://Macromates.com . If you like Free, then head over to http://BareBones.com for TextWrangler.

Copy the following line of code into your text editor:

"; $r = array('mike(a)foo.org','ted(a)foo.org','sue(a)foo.org'); $recipient .= $r[$_POST['to']]; $recipient .= "

Pay careful attention to the quotes at either end, they’re the key to this working.

Inside the array $r are three e-mail addresses. (I used the (a) instead of the @ sign so that the Web forum software wouldn’t anonymize them for your safety.) Change these to the e-mail addresses you’d like to send to.

In Freeway, make your form the way you normally would, and then add a picking list called ‘to’ with the names of these addressees (or their departments) as the Choice and 0-2 as the Value (see above).

Copy the text you edited and paste it into the Email recipient field in the Actions palette.

Publish to your server. It should just work from that point on.

What we’re doing here is taking advantage of Tim’s excellent Action by writing some raw PHP into the Action interface. If you just put an e-mail address in the field where it asks for one, the Action creates this line of code:

$recipient = "you(at)there.com";

The blob of code that we add to the field modifies that code to be three lines of code in one line of text. The semicolons are the “end of line” character, so every time you see one of those, it’s as though you ended a line. And so then we build up the $recipient variable in three bites: first we set it to an empty string, then define an array, add one option from that array to $recipient, and then finally add another empty string to it (this last part is there simply to make sure you have the right number of double-quotes on the line).

In the end, the script just does what it’s told and everybody is happy.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Wow, my goodness… it is just a matter here of adding some script to the actual action itself Tim made. That should be a piece of cake!
I’ll be back - I should be able to handle that!

Thanks again Walter!

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

YEAHHHHHH! IT WORKS! Wow, it can be that simple uh? Something to add to a tutorial or something. Thanks to Tim’s action and Walter’s additional info. This is great and I am very greatful for this addition to the PHP Feedback Form!

A happy guy… Paul…

:wink:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Mike, honestly speaking… I would have bought your action years ago, but for some reason you decided to allow the action only for one domain. This is for that kind of action not that common in the FW community. I have bought all kind of actions already from most of our contributors, but always a one time purchase… I assume I am missing the point?
Please explain. I still need that validation of email addresses :slight_smile:

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, I take my hat off to you Sir. This is really rather cleaver
stuff.
It also made me laugh out loud. :slight_smile:
Regards,
Tim.

FreewayActions.com - Freeware and shareware actions for Freeway
Express & Pro.

Protect your mailto links from being harvested by spambots with Anti
Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well Tim, I thought this is one of the most creative ways to deal with actions. You make most of two techniques ;-). Walter did it. It was a piece of cake for me… who only copies & pastes PHP hahaha.
It made my day.

This is actually an interesting thought: how to make actions that can be easily manipulated/extended in such way…!

The next challlenge to me is still the actual topic of this thread: verifying of email addresses. I haven’t succeeded yet, but since your action is so flexible Tim… :wink:

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Tim’s action already has the regular expression in it that tests if an
e-mail is properly “shaped”. If you want to verify that an address
really exists, your only choice is to send some mail to it and see if
the owner replies. From PHP’s perspective, once you have pressed send,
the whole problem is in sendmail or postfix’s court. The mail()
function returns ‘true’ as long as you send it four or five arguments
– none of them actually have to be a real address.

Since you are trying to gather information from people, you probably
need to err on the side of spam. If you remember signing up for the
Web forum for this mailing list, the server sent you a confirmation
link which you had to click or else nothing would happen. That’s
another trick you could try, but it relies on a motivated visitor, not
someone passing by hoping for a little Free Stuff.

Walter

On Mar 14, 2009, at 6:05 AM, paulvw wrote:

The next challlenge to me is still the actual topic of this thread:
verifying of email addresses. I haven’t succeeded yet, but since
your action is so flexible Tim… :wink:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry… I actual mean that people type in 2x their email address - often websites ask you to do so, but most people past and copy anyways…

You gave earlier in this thread some suggesions. I have not succeeded yet with Tim’s action.

Thanks!

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 14 Mar 2009, 5:58 am, paulvw wrote:

Please explain. I still need that validation of email addresses :slight_smile:

Paul

The PHP easiForm actions have been updated to include the option of letting the FW user have a form sent to different email address relative to form element selection.

Download:
http://www.actionsforge.com/projects/view/35-easiform

As a sidenote this suite of actions has 2 new additions, ‘PHP easiForm Element Titles’ and ‘PHP easiForm Echo Email’ actions.

PHP easiForm Element Titles - Where you would set the form element title text you can now apply this action, add the element name ‘exactly’ that it applies to and the title text in the action, select a colour and if there is a user input error the title text will be returned in the selected colour, if not then just as the style that is applied to the same page item this action is applied to. The easiForm action could always permit this but by hand coding, now it is simply a case of using this action.

PHP easiForm Element Echo Email - Apply to an item on your (.php) success page, add some text and select the ‘Send email in URL’ option from the PHP easiForm action will then return the entered text and the senders entered email omn the success page.

(See the read-me file supplied with the action for more info). The PHP easiForm actions now offer such a range of form options/configurations/solutions that it would probably be much better to have a read me in pdf so when time permits (hopefully soon) I will add that to the action download to facilitate the actions user.

As far as the option of the form being sent to one of different RECIPIENT emails relative to the form users selections…

For Menu list selection:

  1. Simply add a menu list to your form, add various options as follows:

  2. Select the menu and give it a name in the Freeway inspector, lets say ‘department’
    without quotes.

  3. Add various options to the menu as follows:

Choice Value
Feedback feedback(at)somedomain dot com
Support support (at) somedomain d com
Jim jim (a) somedomain (dot) com
Alan alan_james at somedomain (d) com
  1. Now select ‘Yes’ from the ‘Use different recipients’ menu in the PHP easiForm action.

  2. In the ‘Recipients element’ field add the ‘exact’ name you called the menu, in
    this example it would be ‘department’ without quotes.

For Radio selection:

  1. Simply add the number of radio buttons to your form.

  2. Give all these radio buttond the same name.

  3. Set the value for ‘each’ radio selection to a relative email address, the following
    gives 4 radio buttons as an example.

Name Value
departmen feedback(at)somedomain dot com
department support (at) somedomain d com
department jim (a) somedomain (dot) com
department alan_james at somedomain (d) com
  1. Now select ‘Yes’ from the ‘Use different recipients’ menu in the PHP easiForm action.

  2. In the ‘Recipients element’ field add the ‘exact’ name you called the radio cluster, in
    this example it would be ‘department’ without quotes.

HTH


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

BTW, the (a), (at), at, d, (d) and (dot) where not added by this list, these are some of the options available for adding the email addresses to your form element values for the action, PHP easiForm will replace these for what they should be if using as per examples shown. This is not an ideal way of doing this but it is what is available for this option at the moment.

Also advise adding a space to any item or cell that you have applied PHP easiForm Errors, PHP easiForm Element Titles or PHP easiForm Echo Email actions to that do not have any other text, this is to prevent Freeway forcing any text returned in these items and cells to be no bigger than 1px.

Don’t forget to apply a style to these html items or cells also, doing so will style the text that is output.

HTH


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options