0

I followed a tutorial that went like so:

        ajaxRequest.onreadystatechange = function(){
            if(ajaxRequest.readyState == 4){
                //use the value  passed in to return response to correct button
                e = document.getElementById("RB" + number);
                e.value = ajaxRequest.responseText + number;
            }

        }

        ajaxRequest.open("GET", "Reject.php" + number, true);
        ajaxRequest.send(null); 

I need to pass number for a mysql function in Reject.php. However, despite the example working for the tutor, my file wants to append the number onto the reject.php giving me a 404 error. What am I doing wrong? In my Reject.php:

   $ID = $_GET['number'];

1 Answer 1

2

You need to pass a querystring, just like any other URL:

"Reject.php?number=" + number
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.