[英]Problem using Javascript to redirect to a URL with a query string
<script type="text/javascript">
function Edit(id)
{
if(confirm("Are you sure to edit?")==true)
{
location.href='employee_set.php&edit='+id;
}
}
</script>
<?php
if(isset($_GET["edit"])==false) {
echo "no response";
} else {
echo "link success";
}
?>
My problem is the Javascript is OK. 我的问题是Javascript还可以。 The location href example.
location href示例。 http://localhost/employee_set.php&edit=30 ...
http://localhost/employee_set.php&edit=30 ...
The PHP code is not working. PHP代码无法正常工作。 Error is not found.
找不到错误。
location.href='employee_set.php&edit='+id;
应该
location.href='employee_set.php?edit='+id;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.