Undefined index...!!!!!!!!!!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
bubberz
Forum Newbie
Posts: 14
Joined: Wed Jul 13, 2005 12:05 pm

Undefined index...!!!!!!!!!!!!!

Post by bubberz »

I've got a page a user sees if they're a new user. They enter an email and password.

If the "Check New Username" behavior allows the entry to continue, the new user will enter more information about themselves.

I'm trying to use the Email and password for the first two text fields in the next form via Bindings / Form Variable, but get the following for both these fields:

Undefined index: Email in <b>C:\htdocs\NewSubInfo.php

The HTML is:

value="<?php echo $_POST['Email']; ?>"

This should be pretty simple, but I'm not too sure what I'm doing wrong.

I've checked to make sure the spelling is correct.

For the button click on the first page, here's the code that's called to decide which page to go to next:

Code: Select all

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO main (Email, Password) VALUES (%s, %s)",
                       GetSQLValueString($_POST['Email'], "text"),
                       GetSQLValueString($_POST['password'], "text"));

  mysql_select_db($database_connLE, $connLE);
  $Result1 = mysql_query($insertSQL, $connLE) or die(mysql_error());

  $insertGoTo = "NewSubInfo.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
*******************

What's odd is if I take the <?php echo $editFormAction; ?> action out of the form and put in NewSubInfo.php (keep the method to Post), the two fields on the next page are in fact populated w/o errors. A a var_dump($_POST) gives me an array(0).

d11wtq | Please use

Code: Select all

 tags around your PHP code[/color]
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Moved to PHP Code
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

Use [ php ] tags around your code. Another tihng: Cross-post?
bubberz
Forum Newbie
Posts: 14
Joined: Wed Jul 13, 2005 12:05 pm

Post by bubberz »

Sorry...newbie screwup!

My bad!
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Please do not cross-post.

viewtopic.php?t=42274

Topic locked.
Locked