csdn产品小助手 2013-03-17 20:48 采纳率: 0%
浏览 32

在mysql中发布ajax数据

I have an ajax code that automatically send the information of an html form to mysql without clicking submit. In mysql, I see that the script send no information. Blank data. I see that the script connection with mysql is good because I see a new result but the result is empty(no text or value) Here is my ajax code and my php code:

  • 写回答

1条回答 默认 最新

  • python小菜 2013-03-17 20:54
    关注

    Your data string doesn't comply with your post variables.

    var data = "newQuickMEGA=" + Megalink +  "&nameQuickMEGA=" + Filename +  "&sizeQuickMEGA=" + Filesize +  "&filecat=" + Filecate;
    
    $link = $_POST['Megalink'];
    $name = $_POST['Filename'];
    $size = $_POST['Filesize'];
    $cat = $_POST['Filecate'];
    

    The following would work:

    $link = $_POST['newQuickMEGA'];
    $name = $_POST['nameQuickMEGA'];
    $size = $_POST['sizeQuickMEGA'];
    $cat = $_POST['filecat'];
    
    评论

报告相同问题?

悬赏问题

  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 matlab解优化问题代码
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导
  • ¥15 docker模式webrtc-streamer 无法播放公网rtsp
  • ¥15 学不会递归,理解不了汉诺塔参数变化
  • ¥15 基于图神经网络的COVID-19药物筛选研究
  • ¥30 软件自定义无线电该怎样使用