How to capture a website url in the shopify contact form

This question already has an answer here:

  • Get the full URL in PHP 28 answers

  • create a hidden input

    <input type="hidden" value="" id="hiddenurl" name="url"/>
    

    and add javascript:

    var a = document.getElementById('hiddenurl');
    a.value = window.location.href;
    

    <p><?= htmlentities( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ?></p>
    
    链接地址: http://www.djcxy.com/p/42288.html

    上一篇: 使用PHP获取URL参数

    下一篇: 如何在shopify联系表单中捕获网站网址