dsgoj7457 2015-04-22 01:50
浏览 52

如何将值从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

  • 写回答

1条回答 默认 最新

  • dongtangu6144 2015-04-22 02:07
    关注

    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

    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划