Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Exclamation why won't my form redirect when submitted?!!

    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

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,637
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    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

  • Users who have thanked VIPStephan for this post:

    mostlyobesekev (09-08-2011)

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Exclamation

    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?

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,637
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    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)?

  • Users who have thanked VIPStephan for this post:

    mostlyobesekev (09-08-2011)

  • #5
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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?

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,637
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    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.

  • Users who have thanked VIPStephan for this post:

    mostlyobesekev (09-08-2011)

  • #7
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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

  • #8
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    The form is sending variables here: /cgi-bin/cgiemail/myemailform.txt
    Please give us the content of this file.

  • #9
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,637
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    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?

  • Users who have thanked VIPStephan for this post:

    mostlyobesekev (09-08-2011)

  • #10
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question

    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?

  • #11
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,637
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    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?

  • Users who have thanked VIPStephan for this post:

    mostlyobesekev (09-08-2011)

  • #12
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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

  • #13
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Smile

    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


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •