This question already has answers here:
"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP
(29 answers)
Can I mix MySQL APIs in PHP?
(4 answers)
Closed 5 years ago.
I'm having a problem here
This is my forgot pass.php code
<?php
if(isset($_POST['submit_email']) && $_POST['email'])
{
require 'connect.php';
include 'connect.php';
$select=mysqli_query($con, "SELECT * from `users` where email='$email'");
if(mysqli_num_rows($select)==1)
{
while($row=mysql_fetch_array($select))
{
$email=($row['email']);
$pass=md5($row['password']);
}
I'm getting the error Undefined variable: email on line 6.
Thanks in advance for helping
Related
This question already has answers here:
"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP
(29 answers)
Closed 4 years ago.
i had a problem in this line, because the error message tell me theres an undefined index:
$strSQL = " UPDATE place SET
rating_value = '".$_POST["rating_value"]."'
WHERE place_id = '".$_POST["place_id"]."'
";
pls help me if you have a solution. thanks
Do you check your variables before do the request like :
if( !empty($_POST["rating_value"]) && !empty($_POST["place_id"]) )
{
// your request
} else {
echo("error");
}
This question already has answers here:
"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP
(29 answers)
Closed 6 years ago.
please could you help me to show the username on the page?
I got this error:
Notice: Undefined index:
<?= $_SESSION['auth']->pseudo; ?>
This is the begining
<?php
session_start();
//require 'functions.php';
$title = "Accueil | Wintrack";
require 'include/header.php';
require 'dbconnection.php';
logged_only();
This question already has answers here:
"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP
(29 answers)
Closed 7 years ago.
here is my php. the session ps comes from a another php page. it comes successfully. but i am getting undefined when i try to use it on the following code to connect to my db.
<?php
$pss = "";
session_start();
if(isset($_SESSION['ps'])){
$pss = $_SESSION['ps'];
}
echo $pss;
$connect = mysqli_connect("localhost","root","","erthiph_asksheikh851821217");
mysqli_query($connect,"INSERT INTO `as_questions`(`Qid`, `M_class`, `S_class`, `Question`, `Answer`, `Doctor`, `Time`) VALUES
('','','','".$pss."','','',CURRENT_TIMESTAMP)");
?>
the above code works. i replaced '$_POST[postquestion]' with '".#pss."'
please check edit history to check edits.
change '$_POST[$pss]' to '".$pss."'
This question already has answers here:
"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP
(29 answers)
Closed 7 years ago.
i have got this code in my connect.php
$firstname=$_POST['firstname'];
$_SESSION['firstname']=$firstname;
And this in my Main.php
$_SESSION['firstname']=$firstname;
echo $firstname;
But it gives me this error Undefined variable: firstname in
In your connect you should have something like
<?php
session_start();
$_SESSION['firstname'] = $_POST['firstname'];
and in Main.php
<?php
session_start();
echo $_SESSION['firstname'];
This question already has answers here:
"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP
(29 answers)
Closed 8 years ago.
Im getting the following error: Notice:undefined index:done
please advise what is wrong
<?php
if($_Get['done']==1 $msg = "Account details saved";
?>
Check first if the key exists, then the comparison to 1.
if (isset($_GET['done']) && $_GET['done'] == 1) {
$msg = '...';
}