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

Posted by Jordan Pagaduan on Stack Overflow See other posts from Stack Overflow or by Jordan Pagaduan
Published on 2010-05-31T05:16:08Z Indexed on 2010/05/31 5:32 UTC
Read the original article Hit count: 232

Filed under:
|

Javascript

<script type="text/javascript">
function Edit(id)
{
    if(confirm("Are you sure to edit?")==true)
    {
        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.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript