0

I am currently working on a form that has specific user related data on curl call which is why "$form->data" line is required. I have to add a tracking code (google) to a thank you page that needs to auto redirect after a certain time on the page. So the process would be like this:

  1. User completes form.
  2. Form redirects to thank you page with tracking code.
  3. Thank you page redirects to login page after say 10 seconds.

Here is the code I currently have on the thank you page, that as far as I know does not trigger the Google tracking code because it redirects immediately:

<?php header('Location: '. $form->data['curl_data']->url );
die(); ?>

I also tried via javascript:

<script>
$(document).ready(function () {
window.setTimeout(function () {
location.href = $form->data['curl_data']->url; }, 5000);
}); 
</script>
6
  • redirect using javascript? tutorialspoint.com/… Commented Apr 29, 2019 at 15:59
  • stackoverflow.com/questions/17150171/… here you can redirect using javascript after N seconds Commented Apr 29, 2019 at 16:02
  • Cross browser testing is required Commented Apr 29, 2019 at 16:02
  • mediatemple.net/community/products/dv/204645160/… Commented Apr 29, 2019 at 16:13
  • So I have tried javascript <script> $(document).ready(function () { // Handler for .ready() called. window.setTimeout(function () { location.href = $form->data['curl_data']->url; }, 5000); }); </script> but it does not redirect with the $form-> data line. Ideas? Commented Apr 29, 2019 at 16:14

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.