0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Notice: Undefined indexエラーの対処法

Posted at

エラー内容

Undefined index未定義の配列の要素を使用した時に出るエラー。
$_POST$_GET値を受け取る時によく発生すると言われています。

解決方法

//キー値の場所 : <form method="POST"><input name="キー値"></form>

if ($_POST["キー値"])  
{
   //処理内容
}

$user_email=$post['email'];  

↓

// !emptyで配列の要素が定義されているか確認する。

if (!empty($_POST["キー値"])) 
{
   //処理内容
}

if (!empty($_post["email"])) 
{
   $user_email=$post['email'];  
}

参考元はこちら
(https://qiita.com/wakahara3/items/bb7c8d7a1673b161abe7)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?