0

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.

1 Answer 1

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

should be

location.href='employee_set.php?edit='+id;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.