jwk811 Posted November 22, 2006 Share Posted November 22, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/ Share on other sites More sharing options...
kenrbnsn Posted November 22, 2006 Share Posted November 22, 2006 Is the method on your for "post" or "get"?Ken Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/#findComment-128745 Share on other sites More sharing options...
jwk811 Posted November 22, 2006 Author Share Posted November 22, 2006 post Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/#findComment-128748 Share on other sites More sharing options...
wildteen88 Posted November 22, 2006 Share Posted November 22, 2006 Do you have fields names as txtPSPrice250k, txtPSPrice500k, or anythink named with txtPrice or txtMOPrice?Whats you HTML like for the form fields? Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/#findComment-128752 Share on other sites More sharing options...
kenrbnsn Posted November 22, 2006 Share Posted November 22, 2006 At the start of the processing page, enter these statements for debugging:[code]<?phpif (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 Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/#findComment-128753 Share on other sites More sharing options...
jwk811 Posted November 22, 2006 Author Share Posted November 22, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/#findComment-128754 Share on other sites More sharing options...
wildteen88 Posted November 22, 2006 Share Posted November 22, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/#findComment-128756 Share on other sites More sharing options...
jwk811 Posted November 22, 2006 Author Share Posted November 22, 2006 nothing came up but i think maybe i did it wrong Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/#findComment-128757 Share on other sites More sharing options...
jwk811 Posted November 22, 2006 Author Share Posted November 22, 2006 nope nothing is coming up with that ken.. its $_POST['submit']; is not set.. i dont understand Quote Link to comment https://forums.phpfreaks.com/topic/28150-undefined-index/#findComment-128758 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.