php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49075 $_POST
Submitted: 2009-07-27 13:45 UTC Modified: 2009-07-27 14:05 UTC
From: DALamberty at hotmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3.0 OS: Windows XP
Private report: No CVE-ID: None
 [2009-07-27 13:45 UTC] DALamberty at hotmail dot com
Description:
------------
I am trying to pass data from a text field thru $_POST to a varialbe
while the text field is blank because it hasn't been filled in I get a undefined index warning from the names assigned to the text fields.
I have tryed assigning a starting value to the text fields, but I still get the undefined index. I have tryed the ISSET() and EMPTY()
on the variable thru $_POST but it doesn't allow the fields to be populated when its time to populate.

Reproduce code:
---------------
$var = $_POST['var']; $edit = isset($_POST['edit']); $editto = isset($_POST['editto']);
print "<form action = 'form.php' method = 'post'>
<input type = 'submit' value = 'Edit' name= 'edit'></form>";
if ($edit) {
print "<form action = 'form.php' method = 'post'>
SSN: <input type = 'text' name = 'var' size = '10'>
<input type = 'submit' value = 'submit' name = 'editto'>";
}
if ($editto) {
print "$var"
}

Actual result:
--------------
before information is input:

Notice: undefined index: var in C:\wamp\www\folder\form.php on line ##

after text is entered into text field the notice goes away.

I have tryed ISSET and EMPTY on the varialbe that is suppose to recieve the text but it then doesn't transfer any text.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-27 14:05 UTC] scottmac@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC