Web Analytics Made Easy -
StatCounter why won't my form redirect when submitted?!! - CodingForum

Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 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: [email protected]
    To: [email protected]
    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
    Stop solving problems you don’t yet have!

    Comment


    • #3
      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: [email protected]
      To: [email protected]
      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?

      Comment


      • #4
        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)?
        Stop solving problems you don’t yet have!

        Comment


        • #5
          The content of the txt file is:

          From: [email protected]
          To: [email protected]
          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?

          Comment


          • #6
            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.
            Stop solving problems you don’t yet have!

            Comment


            • #7
              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

              Comment


              • #8
                The form is sending variables here: /cgi-bin/cgiemail/myemailform.txt
                Please give us the content of this file.
                Blog | Twitter
                Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
                CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
                Remember: no link, no code, no help!

                Comment


                • #9
                  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?
                  Stop solving problems you don’t yet have!

                  Comment


                  • #10
                    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?

                    Comment


                    • #11
                      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?
                      Stop solving problems you don’t yet have!

                      Comment


                      • #12
                        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

                        Comment


                        • #13
                          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

                          Comment

                          Working...
                          X
                          😀
                          🥰
                          🤢
                          😎
                          😡
                          👍
                          👎