Jump to content

Array, Web Forms, undefined index


Recommended Posts

I have a simple web form that is posting values to an array called info like so:

<input type="text" name="info['fname']" size="20">
<input type="text" name="info['lname']" size="20">

on the subsequent page I am calling for the array like so:

$info = $_POST['info'];

and then I am trying to fill the captured information into a printable form like so:

<?php print $info['fname'] ?><?php print $info['lname'] ?>

I am getting an Notice: Undefined index: fname in C:\Inetpub\wwwroot\lead_sheet.php on line 35.  What am I doing wrong.

When I attempt to print_r($_POST); the post is printed and the keys are all there just a defined on the previous page.  Any help would be appreciated and I could post more code if necessary.
Link to comment
https://forums.phpfreaks.com/topic/26477-array-web-forms-undefined-index/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.