• I have a subscription page where the user hits the submit button and the form action sends the email address which works fine. I am trying to redirect on submit to a thank you page. I have tried name=”redirect” and it does not work.

    Any ideas?

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • the redirect goes in the script that is executed after the submit button is clicked. You can use PHP
    header(“Location: $redirect_url”);
    where $redirect_url is assigned before the header statement. That line has to be in the code before any output has been sent to the browser

    Thread Starter jimm4444

    (@jimm4444)

    I am unclear on your answer. Here is the code I am using:

    <input type=”submit” value=”Submit” / >

    <input type=”hidden” name=”redirect” value=”https://66.147.244.153/~minnesq4/thank-you/&#8221; />

    Not sure how to add the code you mentioned above.

    you can’t redirect a form in the way you are attempting to, unless you have some javascript running or the form processing script is already looking for a field named redirect in its script.

    without knowing what script you are using or what that script is doing, there is no way to answer your question.

    the gist is that HTML forms are processed through an action=”filename.php” attribute on the form tag, or else through a javascript routine taking over when a form is submitted. Either of these call a script (could be the same PHP page the form is on) which then processes the fields that were entered on the form.

    what you are doing is passing a hidden field named redirect with a URL as its value, to a forms script. That script then reads the values passed in that hidden field and will redirect the user to the field passed as its value when the script completes. The script must have that feature built in – for example, if you found that code on a forum post and added it in as a result, unless the script you are using expects to receive a hidden field with those values, its not going to redirect just because you have a field named redirect in your form – the script has to be programmed to do that. That is why I can’t answer your question without knowing what the form action script is doing. What you are seeking can easily be done, as long as the script is already programmed to do it.

    Thread Starter jimm4444

    (@jimm4444)

    This is the form I would like to redirect to when the submit button is clicked: https://xx.xxx.xxx.xxx/domainname/thank-you/)

    This is all of the code in the file (I don’t know what js code I need to include in this file):

    <h1>Join Our Fan Club</h1>

    <form action=”mailto:[email protected]?subject=Join Our Fan Club” enctype=”text/plain” method=”post”>
    <table border=”0″ cellspacing=”0″ cellpadding=”2″>
    <tbody>
    <tr>
    <td align=”right”>Please enter your email: </td>
    <td><input name=”email” size=”60″ type=”text” /></td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td><input checked=”checked” name=”subscribe” type=”radio” value=”yes” /> Subscribe</td>
    <td><input name=”subscribe” type=”radio” value=”no” /> Unsubscribe</td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td><input type=”submit” value=”Submit” /></td>
    <td><input type=”reset” value=”Clear” /></td>
    </tr>
    </tbody></table>
    </form>

    What happens now when someone subscribes? Do you receive the email? Does the person still see the email signup form after they click Submit? Are they getting any message or acknowledgment at all that the email was submitted?

    You will have to add some PHP to that code to accomplish what you want.

    Is this form on a WordPress post? WordPress page? regular HTML page?

    Thread Starter jimm4444

    (@jimm4444)

    I am using a wordpress template webpage. Right now, we are receiving the email, and the sendor is also getting a copy of the email (not intentional – just seems to be working that way). There is no message of acknowlegdement of receipt of the email. We figured just having the thank you page would be enough.

    When they click submit, the form itself is still seen – the form doesn’t change, and all data remains on the page – the user would not know that the email was sent, unless they checked their email sent mail.

    When you say “a wordpress template webpage”, do you mean a theme out of the box not changed, or that you have created a WordPress custom page template?

    You are going to have to replace the way you are generating the email to get the result you want. The best way will be to create a custom WordPress page template and put the PHP code in it.

    If you let me know which, I will try to help you. I recently did a small project that is basically exactly what you are looking to do, just have to adapt its code to WordPress. so let me know, if you still seek help.

    Yo, stvwlf

    I’ve been having a similar problem with my form code. I submit the form and receive email notification on both ends but WordPress takes me to the proper url but displays an error. If I hit refresh the page still displays an error. But if I go to the page directly, it works perfectly.

    What seems to be the issue here? This one has got me stumped…

    mathewneer ,

    same issue here , i think this is with wordpress settings. if u find any soultion please help me.

    thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘redirect page after submit’ is closed to new replies.