Linked Questions
13 questions linked to/from Undefined index with $_POST
1373
votes
29
answers
2.2m
views
"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP
I'm running a PHP script and continue to receive errors like:
Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php on line 10
Notice: Undefined index: my_index C:\wamp\www\...
0
votes
0
answers
95
views
issues using htmlspecialchars($_POST['']) to keep data on value after submitting [duplicate]
I am using htmlspecialchars($_POST['']) to keep the data submitted with errors on my registration form,
<form method="post" action="<?php echo htmlspecialchars( $_SERVER['PHP_SELF']) ;?> "&...
-3
votes
2
answers
62
views
Not sure what I am missing? [duplicate]
Could someone please help, I am not sure of what I am missing here.
This is the error I get:
Notice: Undefined index: post_id in C:\xampp\htdocs\projects\charlesprater\post.php on line 6
And this is ...
0
votes
0
answers
29
views
How can i store data in login datetime table? [duplicate]
my project is to create a journal for diabetic patients. First, when the user logging in, the timestamp will be captured and inserted into the database. And then when the user go to next page to ...
0
votes
0
answers
20
views
getting undefined index in php when sending data from ajax [duplicate]
I need to send ajax data to the PHP POST method, but I get undefined index "name". I have tried including dataType: json in ajax and json_encode().
In console, I am getting the whole HTML ...
13
votes
4
answers
28k
views
Swift 4 send POST request as x-www-form-urlencoded
I want to send a POST request to my php 7 server which accepts data as application/x-www-form-urlencoded. The data I have is inside a Struct and I want to get every property of this struct as a ...
22
votes
3
answers
10k
views
Why is better to use filter_input()?
This should be a elementary question but why is better to use something like this:
$pwd = filter_input(INPUT_POST, 'pwd');
Instead of just:
$pwd = $_POST['pwd'];
PS: I understand that the filter ...
3
votes
2
answers
3k
views
What is the best way to access unknown array elements without generating PHP notice?
If I have this array,
ini_set('display_errors', true);
error_reporting(E_ALL);
$arr = array(
'id' => 1234,
'name' => 'Jack',
'email' => '[email protected]',
'city' => array(
'...
-2
votes
6
answers
3k
views
$_POST undefined index PHP error
My html code which receives the string:
<!DOCTYPE html>
<head>
<title>title</title>
</head>
<body>
<font face="Segoe UI" siz ="3">
<form ...
-1
votes
1
answer
1k
views
Undefined index in $_POST[...] [duplicate]
When I run the following code, I get this error:
Notice: Undefined index: user in C:\wamp\www\moviel.php on line 3
And also this:
Notice: Undefined index: pass in C:\wamp\www\moviel.php on line 4
I ...
1
vote
2
answers
95
views
PHP PDO table not updating data [closed]
I'm new to coding with PHP, and in trying to create a to-do list I have come undone after creating a file called 'add.php' which is supposed to add new data to the table. The main file, index.php, ...
0
votes
0
answers
78
views
send data and image to PHP through AJAX
I am trying to pass my data along with an image to php but it was throwing error undefined index my code is as follows
HTML
<form class="form-horizontal" name="event" id="event" enctype="...
0
votes
0
answers
15
views
Posting into a database [duplicate]
Please, i just started php programming and i have a project to build an E-commerce website, to post into my customer database i use the following codes
<?php
$connect = mysqli_connect("...