开发者

Problem using Javascript to redirect to a URL with a query string

开发者 https://www.devze.com 2023-01-02 04:59 出处:网络
Javascript <script type=\"text/javascript\"> function Edit(id) { if(confirm(\"Are you sure to edit?\")==true)

Javascript

<script type="text/javascript">
function Edit(id)
{
    if(confirm("Are you sure to edit?")==true)
    {
    开发者_C百科    location.href='employee_set.php&edit='+id;
    }
}
</script>

PHP

<?php
if(isset($_GET["edit"])==false) {
    echo "no response";
} else {
    echo "link success";
}
?>

My problem is the Javascript is OK. The location href example. http://localhost/employee_set.php&edit=30 ...

The PHP code is not working. Error is not found.


location.href='employee_set.php&edit='+id;

should be

location.href='employee_set.php?edit='+id;
0

精彩评论

暂无评论...
验证码 换一张
取 消