小编The*_*i.9的帖子

开始jQuery帮助

我正在尝试使用php和jQuery创建一个简单的MySQL Admin.我从来没有使用过jQuery,所以我的代码可能非常值得.我对代码的问题是,当我点击按钮时,没有任何反应.我知道偶然的火,因为如果我在firefox中打开html文件(不是去网址,使用文件:///东西)并点击它,它会在框中显示我的PHP代码我希望返回的内容进入.我要做的第一件事是连接到指定的数据库并返回表的列表.继承我的代码

的index.html

<html>
    <head>
        <script type='text/javascript' src='jquery.js'></script>

        <script type='text/javascript'>
            var Server = 'None';
            var Username = 'None';
            var Password = 'None';
            var Database = 'None';

            $("#connect").click(function() {
                Server = $('#server').val();
                Username = $('#username').val();
                Password = $('#password').val();
                Database = $('#database').val();
                loadTables();
            });

            function loadTables() {
                $.get("display.php", { server: Server, username: Username, password: Password, database: Database, content: "tables" },
                    function(data){
                        html = "<ul>";
                        $(data).find("table").each(function() {
                            html = html + "<li>" + $(this).text() + "</li>";
                            });
                                            html = html + "</ul>";
                        $('#content').html(html); …
Run Code Online (Sandbox Code Playgroud)

javascript php mysql jquery

0
推荐指数
1
解决办法
588
查看次数

C:赋值中不兼容的类型

我正在编写一个程序来检查端口是否在C中打开.特别是一行将其中一个参数复制到char数组中.但是,当我尝试编译时,它说:

错误:赋值中的类型不兼容

继承人的代码.错误在于分配addr

#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int main(int argc, char **argv) {
  u_short port;                /* user specified port number */
  char addr[1023];             /* will be a copy of the address entered by u */
  struct sockaddr_in address;  /* the libc network address data structure */
  short int sock = -1;         /* file descriptor for the network socket */ …
Run Code Online (Sandbox Code Playgroud)

c

0
推荐指数
2
解决办法
4473
查看次数

Symfony $ sf_params undefined

我刚刚开始与Symfony合作.我下载了sf_sandbox,我遇到了$ sf_params的问题.当我尝试使用任何方法时,例如$sf_params->has('status')我收到错误:

注意:未定义的变量:第14行/var/www/sf_sandbox/apps/frontend/modules/login/actions/actions.class.php中的sf_params致命错误:在/中的非对象上调用成员函数has()第14行的var/www/sf_sandbox/apps/frontend/modules/login/actions/actions.class.php

这是块:

public function executeIndex() {
    if ($sf_params->has('status') && $sf_params->has('message')) {  // <--line 14
        if ($sf_params->get('status') == 'failed') {
            $this->message = $sf_params->get('message');
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

php symfony1

0
推荐指数
1
解决办法
717
查看次数

为什么php会说两个平等的东西是不平等的?

我正在尝试查看用户登录是否输入了正确的密码,该密码存储为md5哈希.当我回显输入的密码的哈希值时,它与数据库中的密码完全匹配,但它仍然认为它是假的.下面是代码:

echo md5($_POST['pass']);

if ($user->match_password($_POST['pass']) == true) {

    ...

} else {

    ...

}
Run Code Online (Sandbox Code Playgroud)

它试图执行^上面的else代码

class user {

    ...

    var $password;

    ...

    function user($id) {
        global $DB;
        $this->db = new db($DB['host'], $DB['user'], $DB['pass'], $DB['database']);

        $this->user_id = $id;
        $u_result = $this->db->run("select * from users where use_id = " . $this->db->escape($this->user_id));

        ...

        $this->password = $u_reuslt[0]['password'];

            ...
    }

        ...

    function match_password($password) {
        return ($this->password == md5($password));
    } 
}
Run Code Online (Sandbox Code Playgroud)

php

-1
推荐指数
1
解决办法
250
查看次数

标签 统计

php ×3

c ×1

javascript ×1

jquery ×1

mysql ×1

symfony1 ×1