Javascript 如何在mysql数据库中存储windows.prompt中输入的记录

Javascript 如何在mysql数据库中存储windows.prompt中输入的记录,javascript,php,mysql,Javascript,Php,Mysql,我正在使用window.prompt在字段中输入数据电子邮件地址 现在我想将字段中输入的值存储在MySQL数据库中。。。我使用PHP作为我的服务器端语言 function onPlayerStateChange(event) { var time, rate, remainingTime; clearTimeout(stopPlayTimer); if (event.data == YT.PlayerState.PLAYING) { time = player

我正在使用window.prompt在字段中输入数据电子邮件地址

现在我想将字段中输入的值存储在MySQL数据库中。。。我使用PHP作为我的服务器端语言

function onPlayerStateChange(event) {
    var time, rate, remainingTime;
    clearTimeout(stopPlayTimer);
    if (event.data == YT.PlayerState.PLAYING) {
      time = player.getCurrentTime();
      // Add .4 of a second to the time in case it's close to the current time
      // (The API kept returning ~9.7 when hitting play after stopping at 10s)
      if (time + .4 < stopPlayAt) {
        rate = player.getPlaybackRate();
        remainingTime = (stopPlayAt - time) / rate;
        stopPlayTimer = setTimeout(pauseVideo, remainingTime * 1000);
        var pvalue=window.prompt("Enter Email");
        document.getElementById("abc").value=pvalue;


      }
    }
  } 

使用AJAX保存数据。@senz使用一个知道如何连接到mysql并插入数据的库。我知道这似乎很明显,但出于安全和数据一致性的原因,请对您的输入进行清理。为了避免利用漏洞,并确保人们以电子邮件格式输入数据。请访问php.net并查找如何执行此操作或查找教程-有很多。然后,当你在做你想做的事情时遇到一些具体问题,请将代码发布到这里并提出问题。@K Neeraj Lal,你能帮我处理代码吗?