2010-06-02 23:13
浏览 78

Textarea使用jQuery / MySQL刷新

OK so let's say I have a textarea on the top of my browser and a text input box on the bottom. I want to connect a MySQL database and also whatever I type in the input box to appear in the text area. Sorta like a text RPG...

I know PHP, MySQL, good AJAX, and little jQuery. I just want to know how this is achieved. Thank you.

图片转代码服务由CSDN问答提供 功能建议

好的,假设我的浏览器顶部有一个textarea,底部有一个文本输入框。 我想连接一个MySQL数据库,以及我输入框中输入的任何内容,以显示在文本区域中。 Sorta就像文本RPG ...

我知道PHP,MySQL,优秀的AJAX和小jQuery。 我只是想知道这是如何实现的。 谢谢。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • drx3157 2010-06-02 23:35

    You can do something like this (the code below sends input text to php script which connects to database, does whatever you want it to do and prints a text to be displayed in text area) :

    $("#update_btn").click(function() {
        var txt = $.ajax({
        url: 'your_file.php',
        async: true, // or false, depends on your needs

    To access new_text variable in php script, use $new_text = $_POST["new_text"]

    点赞 打赏 评论

相关推荐 更多相似问题