参考書を元にしたスケジュールアプリに認証機能を追加するところです。
ど素人ですので、お手数おかけしますがサルにもわかるように説明いただけるとありがたいです。
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\pear\Auth.php on line 469
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\pear\MDB2.php on line 390
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\pear\MDB2.php on line 1885
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\pear\MDB2.php on line 2572
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\pear\MDB2.php on line 2595
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\pear\MDB2.php on line 2940
Deprecated: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Auth\Container\MDB2.php on line 93
Deprecated: Non-static method MDB2::connect() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Auth\Container\MDB2.php on line 114
Deprecated: Non-static method MDB2::factory() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\MDB2.php on line 433
Deprecated: Non-static method MDB2::parseDSN() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\MDB2.php on line 376
Deprecated: Non-static method MDB2::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\MDB2.php on line 378
Deprecated: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\MDB2.php on line 574
Deprecated: Non-static method MDB2::errorMessage() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\MDB2.php on line 972
Deprecated: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\MDB2.php on line 743
Deprecated: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\MDB2.php on line 434
Deprecated: Non-static method MDB2::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Auth\Container\MDB2.php on line 129
Deprecated: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Auth\Container\MDB2.php on line 130
Deprecated: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Auth\Container\MDB2.php on line 300
のようなエラーメッセージが表示されますが、該当のファイルがどこにあるかわからない(エラーの内容がわからない)です。
そんな行数もあってどこのファイルの何が間違っているのでしょうか。
自分で書いたコードは下記です↓
MyAuth.php
lang
1<?php 2require_once 'Auth/Auth.php'; 3 4/* ここから--ログインページを生成するユーザー定義関数-- */ 5function myLogin(){ 6 require_once 'login.php'; 7} 8/* ここまで--ログインページを生成するユーザー定義関数-- */ 9/* ここから--認証を実行-- */ 10$params=array( 11 'dns' => 'mysqli://phpuser:psppass@localhost/php10', 12 'table' => 'schedule_user', 13 'usernamecol' => 'uid', 14 'passwordcol' =>'passwd'); 15 16$auth = new Auth('MDB2', $params, 'myLogin'); 17$auth->start(); 18/* ここまで--認証を実行-- */ 19if (!$auth->checkAuth()) { die(); } 20// ↑未認証の場合は処理を終了 21
login.php
lang
1<?php require_once '../Encode.php'; ?> 2<!DOCTYPE html> 3<html> 4<head> 5<meta charset="UTF-8" /> 6<title>PHP入門教室</title> 7</head> 8<body> 9<h3>ログインページ</h3> 10<hr /> 11<form method="POST" action="<?php print(e($_SERVER["PHP_SELF"]));?>"> 12 <div class="container"> 13 <label for="username">ユーザー名:</label><br /> 14 <input type="text" id="username" name="username" size="20" maxlength="30" /> 15 <div class="container"> 16 <label for="password">パスワード:</label><br /> 17 <input type="password" id="password" name="password" size="20" maxlength="30" /> 18 <div> 19 <input type="submit" name="submit" value="ログイン" /> 20<form> 21</body> 22</html> 23
.htacess
lang
1<IfModule mod_php5.c> 2php_value auto_prepend_file "MyAuth.php" 3</IfModule> 4
以上宜しくお願い致します。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/07/07 07:15