|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-07-27 14:05 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 07:00:01 2025 UTC |
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.