如何将值从javascript传递到PHP,然后作为整数传递给oracle数据库

Hi I have a problem passing values from javascript to PHP(in a separate file)

function checked(){  
        var length = document.getElementById("Options").length; 
        alert(length); 
        for(var i = 0;  i < length - 1; i++){
            if(document.getElementById(i).checked){
                var selectedId = i; 
                var slecetedValue = document.getElementById(i).value; 
            }
        } 
    } 

These are the variables calculated in the javascript function. But I need to pass them to a seperate php file to send them to an ORACLE database (hopefully as integers). How exactly can I fix this problem?

Also, how exactly can I send a an integer to an oracle database cause oci_by_name normally sends a varchar but I need a Number.

PS. I know there are examples online but I don't really understand could you give me an example ?

Thanks you

You would use AJAX. Here is a good starting point with an example of JavaScript sending data to a PHP script running on the server. W3Schools

Or you could submit the html form to the server and pass the data to a PHP script as is answered in this stackoverflow question