0

I have a form to upload files and when the user uploads the file and click on submit button it will trigger the php code and upload the file. and it will show the message "File Uploaded" .My requirement is Once the user clicks on submit button it should redirect to the homepage and show the success message there.I have installed the "Quick Page/Post Redirect Plugin" but it is always redirecting to the homepage without even clicking on "Submit" button .Is there any other plugin available to do this?

My message is a custom message returned by PHP code.I have added a javascript event like this

<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
    location = 'homepage url';
}, false );
</script>

but instead of wpcf7mailsent what event I have to add?

2
  • If you need coding approach, you can try to use wp_redirect function and add a query argument, which you can check on a home page and if it exists - show a message. Here is a similar answer - wordpress.stackexchange.com/questions/218013/…
    – anton
    Commented May 5, 2021 at 7:36
  • My message is a custom message returned by PHP code .I have added a javascript event like this <script type="text/javascript"> document.addEventListener( 'wpcf7mailsent', function( event ) { location = 'homepage url'; }, false ); </script> but insted of wpcf7mailsent what event I have to add ?
    – VichuCoder
    Commented May 5, 2021 at 10:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.