Jump to content

undefined index?


jwk811

Recommended Posts

i have a form with the values below but when i submit to the next page all the variables come up saying undefined index.. would you know why? and its weird though because all of them have that error exept for note.. strange? i dont understand how im getting this error.. thanks for the help!
[code] $selling    = $_POST['optSelling'];
$note            = $_POST['mtxNote'];
$PSprice250k      = $_POST['txtPSPrice250k'];
$PSprice500k      = $_POST['txtPSPrice500k'];
$PSprice1mil      = $_POST['txtPSPrice1mil'];
$PSprice1milfor3  = $_POST['txtPSPrice1milFor3'];
$MOprice250k      = $_POST['txtMOPrice250k'];
$MOprice500k      = $_POST['txtMOPrice500k'];
$MOprice1mil      = $_POST['txtMOPrice1mil'];
$MOprice1milfor3  = $_POST['txtMOPrice1milFor3'];[/code]
Link to comment
Share on other sites

At the start of the processing page, enter these statements for debugging:
[code]<?php
if (isset($_POST['submit']))    //this assumes the submit button is named "submit"
  echo '<pre>' . print_r($_POST,true) . '</pre>';
?>[/code]

This will dump the contents of the $_POST array to your screen, so you can see what is being sent to your script.

Ken
Link to comment
Share on other sites

heres one table in the form

[code]  <tr>
  <td width="150" class="label">PER 500,000</td>
  <td class="content"><b>$</b><input name="txtPSPrice500k" type="text" class="box" id="txtPSPrice500k" value="<?php echo $price1x2; ?>" size="5"</td>
  </tr>[/code]

and yes the names are the same
Link to comment
Share on other sites

Ok, do what ken said in his post. What do you get when you submit the form now?

Also make sure your html/form fields are wrapped in the form tags too, that is very important that.

EDIT: Just noticed this:
[quote]<td class="content"><b>$</b><input name="txtPSPrice500k" type="text" class="box" id="txtPSPrice500k" value="<?php echo $price1x2; ?>" size="5[color=red][b]"</td>[/b][/color][/quote]

Look at the highlighted HTML in red. Notice there is no closing tag for your input field. This looks like your problem to me add a closing tag (>) before [nobbc]</td>[/nobbc]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.