Emailform without losing data with captcha error.

Issues related to forms.
Post Reply
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Emailform without losing data with captcha error.

Post by Navaldesign »

Emailform without losing data with captcha error.

Here is the example: http://www.dbtechnosystems.com/wb5/index.php

and here is the link to download the WB5 project: http://www.dbtechnosystems.com/wb5/wb5_memory_form.zip
Open the project. Edit the code in the "confirm" page, to have your own domain name details and email address.
Remeber that you need to change the url of the captcha, according to your own domain/folder

The code that processes the form is a variation of the WB5 built in form processor that allows the error page to display the errors encountered (email address validation, captcha code validation, injection attack attempts).

Please also note that all pages (form page, error page, confirm page) MUST be published as php.

Please note that your goal can be acheived far more easier if you use the DBTS Form Processor Extension, which has this feature built in (as well as other cool features): http://www.wysiwygwebbuilder.com/forum/ ... hp?t=20732
---------------------------------------------------------------------------------
Preview or Confirmation Page: Transfer the data submitted from a form to the thankyou page.


It is quite easy, however, no efficient page formatting can be done with the built in form processor.

Below look at how this can be done, using the modified code of the built in form processor. The advantage of this method is that you can create ANY formating of the thank you /confirm) page using WB5: font size, type, color, style, placement, ANYTHING. You can also put the variables in tables so you can create a sort of Invoice or Order preview just as a real commercial printed form. Your visitor can also print out the page (in that case avoid too many graphics and coloured backgrounds).

Working Demo: http://www.dbtechnosystems.com/wb5/data_merge_form.php

Link to download the zip with the WB5 project:

http://www.dbtechnosystems.com/wb5/wb5_ ... e_form.zip

Please note that this is just an example of how you can do it.

Also, combining the method/script here with the one described above

you can create a "remembering" form, with data merging, and also a "Preview" page that users may check for errors, and the submit (two step submission)

The Preview is highly recommended if this is going to be an Invoice or Order, and the two step submission is almost a "MUST" in these cases.

Please note that your goal can be acheived far more easier if you use the DBTS Form Processor Extension (Preview Object), which has this feature built in (as well as other cool features): http://www.wysiwygwebbuilder.com/forum/ ... hp?t=20732

----------------------------------------------------------------------------------
Form submitting to different email addresses (Departments) depending on visitors selection .

It takes care of multipe departments (actually unlimited...) using a dropdown.

You can test it at http://www.dbtechnosystems.com/wb5/contact_multiple.php

And you can download it at http://www.dbtechnosystems.com/wb5/mult ... tments.wbs

Please note that this script combines the method described in http://www.wysiwygwebbuilder.com/forum/ ... hp?t=14938 with your requirements.

The code in the form page Start of Page should not be changed. Neither should the value of the hidden field.

The processing script is in the page confirm1.php
Please note that you will need to add here the email addresses. You will see the code:



$subject = 'New Submission from our Multiple Department Website form';
$message = 'Values submitted from web site form to department: '.$_POST['department'];
$error_url = 'errorpage1.php';

$address[Sales] = "sales@yourdomain.com";
$address[Assistance] = "assistance@yourdomain.com";
$address[Accounting] = "accounting@yourdomain.com";

$department_error = "Invalid department selection!<br>";// You can change this as required


Customize the parts in red as required.

Please note that i have used three departments in the listbox: Sales, Assistance, Accounting merely as EXAMPLES.

The values in the square brackets MUST be exactly as the values in the form combobox. The email addresses MUST be, for each one, the email address where you want the mail to be sent.

You can also cusomize the Subject, start of the message, and the error that will be displayed (though it NEVER should) if the email address is not found due to a mistype.
Last edited by Navaldesign on Mon Nov 09, 2009 9:37 am, edited 5 times in total.
razorboy
 
 
Posts: 7
Joined: Sat Nov 15, 2008 7:04 pm
Location: Canada

Post by razorboy »

Thank you very much.
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Post by Navaldesign »

Not sure what you mean. The form in these projects accept the characters as the users type them, they don't force any case sensitiveness, IF however you want to do something like this, you should use some Javascript.
www.dbtechnosystems.com
User avatar
misterjones
 
 
Posts: 18
Joined: Sat Aug 09, 2008 11:50 am
Location: South Africa
Contact:

Post by misterjones »

Thanks for this just a question where do I get the capcha.php file from
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Post by Navaldesign »

WB6 has a built in captcha tool, so simply use it.
www.dbtechnosystems.com
User avatar
misterjones
 
 
Posts: 18
Joined: Sat Aug 09, 2008 11:50 am
Location: South Africa
Contact:

Post by misterjones »

Thanks got it
User avatar
me.prosenjeet
 
 
Posts: 1265
Joined: Mon Dec 24, 2007 1:50 pm
Location: Lucknow
Contact:

Post by me.prosenjeet »

Naval,
Due to some reason I am unable to use the DBTS form processor and have to use the conventional WB form. In anyway, I can add this form data retreival system in V6.5? With this version, is the process any simple or I have to do all that I see in the project you have for download for V5?
Check the new Chat GPT and Malware detect extensions at the link below

Check my WB Extensions
Check my WB Templates
---------------------------------------------------------
www.Lucknowwebs.com
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Post by Navaldesign »

Not sure what you mean me... Pls clarify.
www.dbtechnosystems.com
User avatar
me.prosenjeet
 
 
Posts: 1265
Joined: Mon Dec 24, 2007 1:50 pm
Location: Lucknow
Contact:

Post by me.prosenjeet »

I mean the demo project that is included in your download mentions it to be for V5, with version 6.5 do we need to do the same things as in the project or it can be made more simplified now?
Check the new Chat GPT and Malware detect extensions at the link below

Check my WB Extensions
Check my WB Templates
---------------------------------------------------------
www.Lucknowwebs.com
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Post by Navaldesign »

No, it is the same (more or less).
I don't quite understand what you mean by "more simplified".

I simply created the last version with Extension Builder 2.03 so you need WB6.5 . I believe that the sub-version is not important.

Unfortunately, more features a script has, more work you need to set it up. The upcoming version 3.01 has more than 140 properties ! But it DOES a lot of things: PHP validation, MySQL datatypes, Departments, Banned IPs and Email addresses, in-line user codes, Calculations, etc. NOT setting some properties simply means that they will be ignored and the relevant functions disabled.
www.dbtechnosystems.com
User avatar
Rebel Studio
 
 
Posts: 73
Joined: Tue Nov 04, 2008 10:55 pm
Location: NL

Re: Emailform without losing data with captcha error.

Post by Rebel Studio »

He means the captcha code :D

Does the email form still work in wb7 cause not losing data is very important for me :)

edit: it is not loading for me in wb7
jeff11214
 
 
Posts: 59
Joined: Sat Oct 28, 2006 4:22 pm

Re: Emailform without losing data with captcha error.

Post by jeff11214 »

I think my problem is simple, but I can not resolve it. I dowloaded your zip for the WB5 project, however I'm using WB7.
I removed a few fields from the form and changed the form name, but otherwise it is your form.
I changed the Form Name "Action" to reflect the same name.
I changed the Confirm Page HTML to do to my e-mail.

My problem is I get the following message "The verification code you have entered is not correct! Please go back and try again."

When I use my url in the HTML properties on the form page, then no captcha appears. If I leave your URL then the captcha appears, but I get the error message as stated above.

How can I make this work?
http://helpcureleukemia.org/hcl/silent.php
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign »

If you look at the captcha code, you will see:

<img src="http://www.dbtechnosystems.com/wb5/captcha.php" alt="Click for new image" title="Click for new image" style="cursor:pointer" onclick="this.src='http://www.dbtechnosystems.com/wb5/capt ... m()"></div>


In other words, it is still the captcha referring to my own site.

You should replace this with your own:


<img src="http://helpcureleukemia.org/hcl/captcha1.php
" alt="Click for new image" title="Click for new image" style="cursor:pointer" onclick="this.src='http://helpcureleukemia.org/hcl/captcha ... m()"></div>

Double click the HTML box that produces the captcha and change the code.

Please note that this is a rather old post. You can now use the DBTS Form Processor which can preserver the submitted values.

Related thread:

viewtopic.php?t=20732
www.dbtechnosystems.com
jeff11214
 
 
Posts: 59
Joined: Sat Oct 28, 2006 4:22 pm

Re: Emailform without losing data with captcha error.

Post by jeff11214 »

I used your download because I liked the template.
The captcha now shows, but I get the same error message when trying to submit.
"The verification code you have entered is not correct! Please go back and try again."
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign »

The confirm page should only display if a form submission has taken place.

So simply I have added this code in Start of Page:

<?php
if($_SERVER['REQUEST_METHOD'] != 'POST')
{
header('Location: index.php');
}
?>
www.dbtechnosystems.com
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign »

Why not ?

The project principles also apply if you use the built in processor. You ar eprobably doing something wrong.

Of course, using the built in processor modifies the behavior and you need to fix this yourself.
www.dbtechnosystems.com
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign »

I'm sorry, but I don't understand. Why would you need this ?

Using the built in form processor the form submission takes place within your primary page (on the contrary of my example project.

Further more, this thread was about "remembering" the values of the form fields after an error. What does the project you attached here has to do with this ?
www.dbtechnosystems.com
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign »

Please understand that these are two different things. In the example project, the processing code is in the "confirm" page. So I have added this code to redirect to "index" if someone tries to reach the confirm page WITHOUT form submission.

In your case, the processing code is in the first page. So there is no reason to do the redirect from the second to the first.
www.dbtechnosystems.com
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign »

Just add the code I told you in start of Page of the "success" page !
www.dbtechnosystems.com
User avatar
Navaldesign
 
 
Posts: 862
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign »

Maybe you have not understood that you should NOT put this code in your St_msg page. Because, in YOUR project, the processing code is in the "index" page, so there is NO reason why you should put the code in the ST_msg page.

In the example project page the code was there because it also contained the processing code.

There is no reason in your case to do so. and you can NOT do so, otherwise, after each submission, it will always redirect to the index page, so it will not display at all!
www.dbtechnosystems.com
Post Reply