Combine $_GET variables before Submit [closed]

此生再无相见时 提交于 2019-12-04 07:13:42

问题


I am not really sure if this is possible but here is the problem I cant figure out.

Have a from that results in the this link.

End result Link.

http://www.website.com/index.php?a=price_range_A_B

I can not use a from but i can use Input fields. Any ideas?


回答1:


EDIT : Since the OP changed the question I have updated my answer below.

I am putting an example of how you could do this.

<?php  
    $action_path = "index.php";
    ?>

    <script type="text/javascript">
        function submitData() {
            var a = null;
            var _A = document.getElementById("_A").value;
            var _B = document.getElementById("_B").value;

            a = "price_range_" + _A + "_" + _B;

            window.location.href = "<?php echo $action_path; ?>?a=" + a;

            return;
        }
    </script>

    <input type="text" id="_A" maxlength="6" size="5" />
    <input type="text" id="_B" maxlength="6" size="5" />
    <input type="button" value="Submit" onclick="submitData();" />

    <?php
    // the code to be put after </form> goes here
?>


来源:https://stackoverflow.com/questions/13795129/combine-get-variables-before-submit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!