...

View Full Version : why won't my form redirect when submitted?!!



mostlyobesekev
09-07-2011, 07:35 PM
Hi i have a web form for my visitors to fill in and when they click on the submit button i want the user to be redirected to my thank you page. The problem is it doesn't work, please can you chack my code below to see where im goin wrong, iv also included the url of the page where its live so you can fill the form in and see the problem for yourself.

Page url: www.dorey-and-dorey.co.uk/contact.html

<form action="/cgi-bin/cgiemail/myemailform.txt" method="post">
<input type="hidden" name="redirect" value="http://www.dorey-and-dorey.co.uk/contact_thanks.html" />

<label for="Name">Full Name:</label>
<input type="text" name="Name" id="Name" />
<label for="City">Town:</label>
<input type="text" name="City" id="City" />
<label for="Email">Email:</label>
<input type="text" name="Email" id="Email" />
<label for="Message">Message:</label><br />
<textarea name="Message" rows="20" cols="20" id="Message"></textarea>
<input type="submit" name="submit" value="Submit" class="submit-button" />
</form>

many thanks,

Ben

VIPStephan
09-07-2011, 08:08 PM
The form is sent so you probably need to set something in the script that tells it to go to the thank you page (e. g. a URL to that page).



The following email message was sent.

From: web-form@dorey-and-dorey.co.uk
To: info@dorey-and-dorey.co.uk
Subject: Web Form Submission

What is your name? test
What is your city? test
What is your email? test
What is your message? hello world

cgiemail 1.6

mostlyobesekev
09-07-2011, 08:30 PM
Hi thanks for your reply, thats exactly the problem... i have already put code in the form section which is supposed to redirect the page once its been submitted, the code iv put in is:

<input type="hidden" name="redirect" value="http://www.dorey-and-dorey.co.uk/contact_thanks.html" />

this is meant to redirect the user to the page above once they click the submit button like you did but for some reason its ignoring the command and showing the page that you quoted instead:

The following email message was sent.

From: web-form@dorey-and-dorey.co.uk
To: info@dorey-and-dorey.co.uk
Subject: Web Form Submission

What is your name? test
What is your city? test
What is your email? test
What is your message? hello world

cgiemail 1.6


its really confusing?

VIPStephan
09-08-2011, 12:00 AM
Well, you seem to have the debug mode enabled or something like that. Where is the documentation for the script? How does it look like (the content of the text file)?

mostlyobesekev
09-08-2011, 12:37 AM
The content of the txt file is:

From: web-form@dorey-and-dorey.co.uk
To: info@dorey-and-dorey.co.uk
Subject: Web Form Submission

What is your name? [Name]
What is your city? [City]
What is your email? [Email]
What is your message? [Message]


This is all that it contains, how would i know if i have the debug mode on? where would that be?

VIPStephan
09-08-2011, 01:00 AM
There must be some kind of form processing script in the cgi whatever directory, probably a Perl script, that is handling the actual form submission.

mostlyobesekev
09-08-2011, 01:15 AM
all the files contained in the cgi-bin folder are:

cgiecho
cgiemail
entropybanner.cgi
randhtml.cgi

thats all there is, i dont know what type of file they are as thats all they are listed as in the cgi-bin folder

Apostropartheid
09-08-2011, 02:05 AM
The form is sending variables here: /cgi-bin/cgiemail/myemailform.txt
Please give us the content of this file.

VIPStephan
09-08-2011, 12:16 PM
Apostropartheid, the OP gave the contents in post 5. If that’s really what’s in the file then there must be some other script with all the processing code.
mostlyobesekev, what’s in the cgiemail directory?

mostlyobesekev
09-08-2011, 07:04 PM
The cgiemail is just a file it's not a directory, all the files I listed in my previous message are contained in the cgi-bin directory and I can't find any script files?

VIPStephan
09-08-2011, 07:14 PM
Well, the path /cgi-bin/cgiemail/myemailform.txt suggests that a text file called myemailform.txt resides inside a cgiemail directory.

Let me ask a more basic question: Where did you get this form script from? How do you know that <input type="hidden" name="redirect" value="http://www.dorey-and-dorey.co.uk/contact_thanks.html" /> is required to redirect? Where is the documentation that is telling you how to set up this form? Is this something your hosting provider offers as built-in solution?

mostlyobesekev
09-08-2011, 08:24 PM
The cgi-bin is the directory which contains the 'cgiemail' and that communicates with the 'myemailform.txt' file which is situated in the root directory

mostlyobesekev
09-08-2011, 09:45 PM
Great news iv managed to solve the problem. The name="redirect" tag was wrong, instead my hosting provider requires it to say name="success" which iv now done and it works! Wahey!

Thank you for all your help VIPStephan:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum