drjmrg8766 2019-04-29 15:57
浏览 54

PHP使用cURL数据提交表单,并在计时器上跟踪代码自动重定向

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>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 r包runway详细安装教程
    • ¥15 Html中读取Json文件中数据并制作表格
    • ¥15 谁有RH342练习环境
    • ¥15 STM32F407 DMA中断问题
    • ¥15 uniapp连接阿里云无法发布消息和订阅
    • ¥25 麦当劳点餐系统代码纠错
    • ¥15 轮班监督委员会问题。
    • ¥20 关于变压器的具体案例分析
    • ¥15 生成的QRCode圖片加上下載按鈕
    • ¥15 板材切割优化算法,数学建模,python,lingo