質問編集履歴
4
改行
title
CHANGED
File without changes
|
body
CHANGED
@@ -149,30 +149,30 @@
|
|
149
149
|
</div>
|
150
150
|
<div class="panel-body">
|
151
151
|
<!-- Single button -->
|
152
|
-
|
152
|
+
<?php
|
153
|
-
|
153
|
+
try
|
154
|
-
|
154
|
+
{
|
155
|
-
|
155
|
+
require_once('config.php');
|
156
|
-
|
156
|
+
require_once('function.php');
|
157
|
-
|
157
|
+
$mail=$_POST['mail'];
|
158
|
-
|
158
|
+
$pass=$_POST['pass'];
|
159
|
-
|
159
|
+
$dbh=new PDO(DSN,DB_USER,DB_PASSWORD);
|
160
|
-
|
160
|
+
$dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
|
161
|
-
|
161
|
+
$dbh->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
|
162
|
-
|
162
|
+
$sql='SELECT * FROM admin WHERE admin_name=?';
|
163
|
-
|
163
|
+
$stmt=$dbh->prepare($sql);
|
164
|
-
|
164
|
+
$data[]=$mail;
|
165
|
-
|
165
|
+
$stmt->execute($data);
|
166
|
-
|
166
|
+
$dbh=null;
|
167
|
-
|
167
|
+
$rec=$stmt->fetch(PDO::FETCH_ASSOC);
|
168
|
-
|
168
|
+
$user_input = $_POST['pass'];
|
169
|
-
|
169
|
+
if(crypt($user_input, $rec['password'])==$rec['password']){
|
170
|
-
|
170
|
+
session_start();
|
171
|
-
|
171
|
+
$_SESSION['login']=1;
|
172
|
-
|
172
|
+
$_SESSION['nickname']=$rec['nickname'];
|
173
|
-
|
173
|
+
header('Location:index.php');
|
174
|
-
|
174
|
+
exit();
|
175
|
-
|
175
|
+
}
|
176
176
|
else
|
177
177
|
{
|
178
178
|
print 'メールアドレスかパスワードが間違っています。<br />';
|
3
改行
title
CHANGED
File without changes
|
body
CHANGED
@@ -254,4 +254,6 @@
|
|
254
254
|
|
255
255
|
どのようにすべきなのでしょうか?
|
256
256
|
|
257
|
+
改行等何度もチェックして消しているつもりですが・・・・・
|
258
|
+
|
257
259
|
PHP初心者のため、稚拙な質問かも知れませんが、教えてください。
|
2
エラー
title
CHANGED
File without changes
|
body
CHANGED
@@ -243,8 +243,8 @@
|
|
243
243
|
header('Location:index.php');
|
244
244
|
exit();```
|
245
245
|
|
246
|
-
「Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /Applications/XAMPP/xamppfiles/htdocs/p・・・・・・・・・エラー
|
247
246
|
|
247
|
+
|
248
248
|
「Warning: Cannot modify header information・・・」エラー
|
249
249
|
|
250
250
|
「Warning: session_start() [function.session-start]:
|
1
エラー追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -243,6 +243,7 @@
|
|
243
243
|
header('Location:index.php');
|
244
244
|
exit();```
|
245
245
|
|
246
|
+
「Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /Applications/XAMPP/xamppfiles/htdocs/p・・・・・・・・・エラー
|
246
247
|
|
247
248
|
「Warning: Cannot modify header information・・・」エラー
|
248
249
|
|