Request: Confirm Email Address

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
vinman57
Posts: 65
Joined: Thu Jan 17, 2008 4:13 am

Request: Confirm Email Address

Post by vinman57 »

A great job on this script. I would like to see the following feature on the ticket submission form:

Email address: ____________________

Re-enter (confirm) Email address: ________________

I have found that some people enter a wrong email address (inadvertantly). If they do that, there is no way we can contact them.
Having them re-enter their email address - and having the script validate that both emails match - increases the odds that the email is correct.

Thank you for considering this.
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
vinman57
Posts: 65
Joined: Thu Jan 17, 2008 4:13 am

Post by vinman57 »

perfect. Thanks
vforneris
Posts: 2
Joined: Thu Jan 31, 2008 11:17 am

Integration with "Email Piping"

Post by vforneris »

Hi, if anyone needs to add this feature but he/she has already added the email piping (aka email2ticket) feat, just edit the file

process_email.php

adding the line

$_POST['email2'] = $email;

Cheers
Vega
Raven
Posts: 172
Joined: Sat Jun 20, 2009 12:39 am

Re:

Post by Raven »

Hi, any chance of reposting a 'working' link to this mod and also confirming if it will work with v2.2?

Mucho thanko :)
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Request: Confirm Email Address

Post by Klemen »

It's included by default in version 2.3

Now cross your finger that the beta will be out soon :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Raven
Posts: 172
Joined: Sat Jun 20, 2009 12:39 am

Re: Request: Confirm Email Address

Post by Raven »

Nice one :) Hopefully I will be able to just 'borrow' that bit to bolt in to v2.2 rather than spend days re doing my theme when it arrives ;)
fonz
Posts: 6
Joined: Tue Feb 22, 2011 5:28 pm

Re: Request: Confirm Email Address

Post by fonz »

Hey everyone,

Until Klemen gets this done, if you want a quick solution, you can use a bit of javascript. Let me walk you through what I have done for my client.

First, add the second email field to your form. On the index.php page, look for

Code: Select all

<form method="post" action="submit_ticket.php" name="form1" enctype="multipart/form-data">
A few lines below that you will find the email field. It looks like this

Code: Select all

<td style="text-align:right" width="150"><?php echo $hesklang['email']; ?>: <font class="important">*</font></td>
	<td width="80%"><input type="text" name="email" size="40" maxlength="50" value="<?php if (isset($_SESSION['c_email'])) {echo stripslashes(hesk_input($_SESSION['c_email']));} ?>" /></td>
Enter the following code, immediately below the closing </td>tag. This adds the new email field to your form.

Code: Select all

<td style="text-align:right" width="150"><?php echo $hesklang['email2']; ?>: <font class="important">*</font></td>
	  <td width="70%"><input name="email2" type="text" id="email2" onblur="VerifyDataIsIdentical('email','email2')" value="<?php if (isset($_SESSION['c_email2'])) {echo stripslashes(hesk_input($_SESSION['c_email2']));} ?>" size="40" maxlength="50" /></td>
Please note that the reason I have references to "hesklang['email2']" is you need to place an entry in your text.php file. I will give you those instruction later in this post. There is a bit more code than you need in that paste, is because I plan on implementing that into a new MM_ValidateForm later, and I did not want to redo everything.

Next, place this javascript below the table that contains these three entries, on the line immediately below the table closing tag "</table>".

Code: Select all

<script type="text/javascript">
var d1pastval = new String();
var d2pastval = new String();
function VerifyDataIsIdentical(d1,d2) {
var d1val = document.getElementById(d1).value;
var d2val = document.getElementById(d2).value;
if(d1val.length && 
   d2val.length && 
   (d1val != d2val) && 
   ( (d1val != d1pastval) || (d2val != d2pastval) )) {
// alert message is between quotes on the next line. You may change this to any message you want. //
      alert("E-mails must match");
      d1pastval = d1val;
      d2pastval = d2val;
      return false;
   }
return true;
}
</script>
This will only alert your user one time, immediately after they leave the second email field that the two do not match.

Next, open your language/en/text.php file and add the following

Code: Select all

$hesklang['email2']='Please confirm your E-mail';
You can add that anywhere in the file, but I added it at around line 130, just to keep data grouped together.

I hope this helps everyone. When I get the function MM_validateForm done, if Klemen does not object, I will post it here.
Raven
Posts: 172
Joined: Sat Jun 20, 2009 12:39 am

Re: Request: Confirm Email Address

Post by Raven »

Hi, I never thought of just validating it using an in-page routine - I'd got it in my head that it would need to be totally tied in with the whole Hesk database etc.. Sometimes the solution is so easy it escapes me lol

Just thinking now that a quick visit to 'Dynamic Drive' will lead me to a decent email confirmation script that will do the job nicely (unless JavaScript is disabled of course so will need to degrade nicely).

;) Thanks for that :)

I look forward to your next post completing this great (and now so blatantly simple mod) :D
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Request: Confirm Email Address

Post by Klemen »

Thanks for sharing!
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
fonz
Posts: 6
Joined: Tue Feb 22, 2011 5:28 pm

Re: Request: Confirm Email Address

Post by fonz »

Raven and Klemen, you are welcome.

I was wondering if something like this might work, too

Code: Select all

<?php if(isset($_REQUEST['email']) || isset($_REQUEST['email2']))?>

<?php if($_REQUEST['email'] != $_REQUEST['email2']){$errors[] = "Please correctly confirm your email address";} ?>

<?php if(isset($_REQUEST['email2'])){unset($_REQUEST['email2']);} ?>
I haven't had time to do any testing. I need to finish the helpdesk for my client. I am also working on integrating a live chat module if anyone is interested.
Raven
Posts: 172
Joined: Sat Jun 20, 2009 12:39 am

Re: Request: Confirm Email Address

Post by Raven »

Agreed, it would be great to use the same type of error message you get when something else goes wrong as well as perform the email check.

Not getting too much PC time these days what with my 5 week old keeping me busy phew! If you manage to get this working with the Hesk error message as opposed to a javascript popup please share ;)
fonz
Posts: 6
Joined: Tue Feb 22, 2011 5:28 pm

Re: Request: Confirm Email Address

Post by fonz »

Hi Raven,

Sorry I haven't been around lately. The chat/live help addon has taken more time than I expected.

Wow, a baby...congratulations. Your life will never be the same. :lol: You will lose lots of sleep, stay up nights worrying, even be heart-broken from time to time, but it is the best experience of your entire lifetime.

I will share when I get everything done. I think I should post it to Klemen, privately, first.
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Request: Confirm Email Address

Post by Klemen »

Feel free to share it with the public, it's your work :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Raven
Posts: 172
Joined: Sat Jun 20, 2009 12:39 am

Re: Request: Confirm Email Address

Post by Raven »

fonz wrote:Hi Raven,

Sorry I haven't been around lately. The chat/live help addon has taken more time than I expected.

Wow, a baby...congratulations. Your life will never be the same. :lol: You will lose lots of sleep, stay up nights worrying, even be heart-broken from time to time, but it is the best experience of your entire lifetime.

I will share when I get everything done. I think I should post it to Klemen, privately, first.
Hi and thank you for the congratulations :) She's doing really well and yup sleep is a thing of the past (as is working on my web site) lol

Cheers,

One chuffed Dad *HUGE SMILE*
Post Reply