Emailform without losing data with captcha error.

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

Re: Emailform without losing data with captcha error.

Post by Navaldesign » Thu Sep 01, 2011 5:22 pm

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

mhn-pc
 
 
Posts: 29
Joined: Wed Feb 09, 2011 3:48 pm
Location: Asia
Contact:

Re: Emailform without losing data with captcha error.

Post by mhn-pc » Thu Sep 01, 2011 5:28 pm

If I use the Built-in PHP form processor, Is there no problem ?

mhn-pc
 
 
Posts: 29
Joined: Wed Feb 09, 2011 3:48 pm
Location: Asia
Contact:

Re: Emailform without losing data with captcha error.

Post by mhn-pc » Thu Sep 01, 2011 5:44 pm

I tested with the Built-in PHP form processor, unfortunately does not work !

What should I do?

User avatar
Navaldesign
 
 
Posts: 1200
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign » Thu Sep 01, 2011 6:25 pm

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

mhn-pc
 
 
Posts: 29
Joined: Wed Feb 09, 2011 3:48 pm
Location: Asia
Contact:

Re: Emailform without losing data with captcha error.

Post by mhn-pc » Thu Sep 01, 2011 8:21 pm

I wrote the code, Please download this project !
SampleContact.wbs

User avatar
Navaldesign
 
 
Posts: 1200
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign » Thu Sep 01, 2011 8:32 pm

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

mhn-pc
 
 
Posts: 29
Joined: Wed Feb 09, 2011 3:48 pm
Location: Asia
Contact:

Re: Emailform without losing data with captcha error.

Post by mhn-pc » Thu Sep 01, 2011 8:56 pm

For example, in your project !
When that entering the confirm.php page (for example: http://www.dbtechnosystems.com/wb5/confirm.php), comes the first page (index.php).

I want to do it in my project, I've attached the project and inserted the following code in the success page.

Code: Select all

<?php
if($_SERVER['REQUEST_METHOD'] != 'POST')
{
header('Location: index.php');
}
?>
But it did not work !

Why did not it?
Where is the problem ?
Last edited by mhn-pc on Thu Sep 01, 2011 9:04 pm, edited 1 time in total.

User avatar
Navaldesign
 
 
Posts: 1200
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign » Thu Sep 01, 2011 9:02 pm

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

mhn-pc
 
 
Posts: 29
Joined: Wed Feb 09, 2011 3:48 pm
Location: Asia
Contact:

Re: Emailform without losing data with captcha error.

Post by mhn-pc » Thu Sep 01, 2011 9:12 pm

Navaldesign wrote:So I have added this code to redirect to "index" if someone tries to reach the confirm page WITHOUT form submission.
I like it !
I want to without confirmation is not directed to the success page, of course in the my project !

User avatar
Navaldesign
 
 
Posts: 1200
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign » Thu Sep 01, 2011 9:43 pm

Just add the code I told you in start of Page of the "success" page !
www.dbtechnosystems.com

mhn-pc
 
 
Posts: 29
Joined: Wed Feb 09, 2011 3:48 pm
Location: Asia
Contact:

Re: Emailform without losing data with captcha error.

Post by mhn-pc » Thu Sep 01, 2011 10:12 pm

I did, but it did not work.

Please see this video !
http://www.mediafire.com/?muxurogr5kcku34

User avatar
Navaldesign
 
 
Posts: 1200
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: Emailform without losing data with captcha error.

Post by Navaldesign » Fri Sep 02, 2011 6:41 am

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

mhn-pc
 
 
Posts: 29
Joined: Wed Feb 09, 2011 3:48 pm
Location: Asia
Contact:

Re: Emailform without losing data with captcha error.

Post by mhn-pc » Fri Sep 02, 2011 9:16 am

Thank you for your response. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest