logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-25-2014, 10:15 AM   #1
greg.farmer
 
Join Date: Jan 2012
Posts: 11
Exclamation Notice: Undefined index:

Hi everyone

I have a form which post to a phpmyadmn database. I have made forms in the past but with this form I am getting this error.

Notice: Undefined index: logged by in C:\xampp\htdocs\TSWeb\admin\IT\support\newticket.p hp on line 180

Notice: Undefined index: assigned to in C:\xampp\htdocs\TSWeb\admin\IT\support\newticket.p hp on line 181
Column 'logged by' cannot be null

"Logged by" is a text field and "assigned to" is a drop down list.

When I submit my form both fields have an entry.

I have rebuilt the form and the table in the database twice and am getting this every time.

After 2 weeks of frustration and not finding the solution on Google, I would appreciate your assistance

Thank you for your help in advance.

Here is the PHP code

175 if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "Support Log")) {
176 $insertSQL = sprintf("INSERT INTO `it_support log` (user, category, issue, `logged by`, `assigned to`) VALUES (%s, %s, %s, %s, %s)",
177 GetSQLValueString($_POST['user'], "text"),
178 GetSQLValueString($_POST['category'], "text"),
179 GetSQLValueString($_POST['issue'], "text"),
180 GetSQLValueString($_POST['logged by'], "text"),
181 GetSQLValueString($_POST['assigned to'], "text"));
182
183 mysql_select_db($database_connTSweb, $connTSweb);
184 $Result1 = mysql_query($insertSQL, $connTSweb) or die(mysql_error());
185
186 $insertGoTo = "supportlog.php";
187 if (isset($_SERVER['QUERY_STRING'])) {
188 $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
189 $insertGoTo .= $_SERVER['QUERY_STRING'];
190 }
191 header(sprintf("Location: %s", $insertGoTo));
192 }
greg.farmer is offline   Reply With Quote
Old 09-29-2014, 01:23 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

line 180 180 GetSQLValueString($_POST['logged by'], "text"),

i would change logged by to logged_by and all references to it
you can run a $print_r($_POST); to see what values are actually being received
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:35 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com