在Dreamweaver CS5中检查现有用户时出错

时间:2011-04-10 01:01:14

标签: dreamweaver

我添加了服务器行为以检查电子邮件地址之前是否已被使用过,并且在页面加载时没有错误。但是当我提交时,我收到以下错误消息

  

(!)注意:未定义的变量:第39行的C:\ wamp \ www \ sunglasses \ register.php中的database_null

     

(!)注意:第39行的C:\ wamp \ www \ sunglasses \ register.php中的未定义变量:null   调用堆栈

     

(!)警告:mysql_select_db()期望参数2为资源,在第39行的C:\ wamp \ www \ sunglasses \ register.php中给出null   调用堆栈

     

(!)注意:第40行的C:\ wamp \ www \ sunglasses \ register.php中的未定义变量:null   调用堆栈

     

(!)警告:mysql_query()期望参数2为资源,在第40行的C:\ wamp \ www \ sunglasses \ register.php中给出null

与此相关的代码块是

`$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
  $MM_dupKeyRedirect="/sunglasses/error/registration_error.php";
  $loginUsername = $_POST['email'];
  $LoginRS__query = sprintf("SELECT email FROM customer WHERE email=%s", GetSQLValueString($loginUsername, "1"));
  mysql_select_db($database_null, $null);
  $LoginRS=mysql_query($LoginRS__query, $null) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);

  //if there is a row in the database, the username was found - can not add the requested username
  if($loginFoundUser){
    $MM_qsChar = "?";
    //append the username to the redirect page
    if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
    $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
    header ("Location: $MM_dupKeyRedirect");
    exit;
  }
}`

0 个答案:

没有答案