•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,489 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,705 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1045 | Replies: 1
![]() |
•
•
Join Date: Sep 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Ok my problem is I already success make a form with multiple check box. When I submit form it successfully goes to my mysql database. But the funny thing is on my run screen it's shows error like this.
Notice: Undefined index: kursusa3 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 15
Notice: Undefined index: kursusa5 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 17
Notice: Undefined index: kursusa6 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 18
Notice: Undefined index: kursusb3 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 22
Notice: Undefined index: kursusb4 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 23
Notice: Undefined index: kursusb5 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 24
Notice: Undefined index: kursusb6 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 25
Notice: Undefined index: kursusb7 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 26
Notice: Undefined index: kursusb8 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 27
Notice: Undefined index: kursusb9 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 28
Notice: Undefined index: kursusc3 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 32
Notice: Undefined index: kursusc4 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 33
Notice: Undefined index: kursusc5 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 34
Notice: Undefined index: kursusc6 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 35
Notice: Undefined index: kursusc7 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 36
Thank you for your interest in our course/training modules.
We will contact you to confirm the course/training date.
If you have any questions or need more information, please e-mail or call our office.
Click to go back
======================================================
Ok down here is my php code. Can somebody suggest to me how I'm gonna adjust the code so that undeine thing will not showout?
========================================================
<? $name = $_POST["name"]; ?>
<? $title = $_POST["title"]; ?>
<? $faculty = $_POST["faculty"]; ?>
<? $staffno = $_POST["staffno"]; ?>
<? $teloffice = $_POST["teloffice"]; ?>
<? $telhp = $_POST["telhp"]; ?>
<? $email = $_POST["email"]; ?>
<? $day = $_POST["day"]; ?>
<? $month = $_POST["month"]; ?>
<? $year = $_POST["year"]; ?>
<? $kursusa1 = $_POST["kursusa1"]; ?>
<? $kursusa2 = $_POST["kursusa2"]; ?>
<? $kursusa3 = $_POST["kursusa3"]; ?>
<? $kursusa4 = $_POST["kursusa4"]; ?>
<? $kursusa5 = $_POST["kursusa5"]; ?>
<? $kursusa6 = $_POST["kursusa6"]; ?>
<? $kursusb1 = $_POST["kursusb1"]; ?>
<? $kursusb2 = $_POST["kursusb2"]; ?>
<? $kursusb3 = $_POST["kursusb3"]; ?>
<? $kursusb4 = $_POST["kursusb4"]; ?>
<? $kursusb5 = $_POST["kursusb5"]; ?>
<? $kursusb6 = $_POST["kursusb6"]; ?>
<? $kursusb7 = $_POST["kursusb7"]; ?>
<? $kursusb8 = $_POST["kursusb8"]; ?>
<? $kursusb9 = $_POST["kursusb9"]; ?>
<? $kursusc1 = $_POST["kursusc1"]; ?>
<? $kursusc2 = $_POST["kursusc2"]; ?>
<? $kursusc3 = $_POST["kursusc3"]; ?>
<? $kursusc4 = $_POST["kursusc4"]; ?>
<? $kursusc5 = $_POST["kursusc5"]; ?>
<? $kursusc6 = $_POST["kursusc6"]; ?>
<? $kursusc7 = $_POST["kursusc7"]; ?>
<? $kursusc8 = $_POST["kursusc8"]; ?>
<? $comment = $_POST["comment"]; ?>
<?php
$con = mysql_connect("localhost","root","horatiocsi");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ctlcourse", $con);
mysql_query("INSERT INTO application (name, title, faculty, staffno, teloffice, telhp, email, day, month, year, kursusa1, kursusa2, kursusa3, kursusa4, kursusa5, kursusa6, kursusb1, kursusb2, kursusb3, kursusb4, kursusb5, kursusb6, kursusb7, kursusb8, kursusb9, kursusc1, kursusc2, kursusc3, kursusc4, kursusc5, kursusc6, kursusc7, kursusc8,comment )
VALUES ('$name','$title','$faculty','$staffno','$teloffice','$telhp','$email','$day','$month','$year','$kursusa1','$kursusa2','$kursusa3','$kursusa4','$kursusa5','$kursusa6','$kursusb1','$kursusb2','$kursusb3','$kursusb4','$kursusb5','$kursusb6','$kursusb7','$kursusb8','$kursusb9','$kursusc1','$kursusc2','$kursusc3','$kursusc4','$kursusc5','$kursusc6','$kursusc7','$kursusc8','$comment')");
echo "Thank you for your interest in our course/training modules.";
echo "<br>";
echo "We will contact you to confirm the course/training date.";
echo "<br>";
echo "If you have any questions or need more information, please e-mail or call our office.";
echo "<p><a href=index.htm>Click to go back</a></p>";
mysql_close($con);
?>
Notice: Undefined index: kursusa3 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 15
Notice: Undefined index: kursusa5 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 17
Notice: Undefined index: kursusa6 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 18
Notice: Undefined index: kursusb3 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 22
Notice: Undefined index: kursusb4 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 23
Notice: Undefined index: kursusb5 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 24
Notice: Undefined index: kursusb6 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 25
Notice: Undefined index: kursusb7 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 26
Notice: Undefined index: kursusb8 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 27
Notice: Undefined index: kursusb9 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 28
Notice: Undefined index: kursusc3 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 32
Notice: Undefined index: kursusc4 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 33
Notice: Undefined index: kursusc5 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 34
Notice: Undefined index: kursusc6 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 35
Notice: Undefined index: kursusc7 in c:\program files\easyphp1-8\www\ctlcourseapply\insert_application.php on line 36
Thank you for your interest in our course/training modules.
We will contact you to confirm the course/training date.
If you have any questions or need more information, please e-mail or call our office.
Click to go back
======================================================
Ok down here is my php code. Can somebody suggest to me how I'm gonna adjust the code so that undeine thing will not showout?
========================================================
<? $name = $_POST["name"]; ?>
<? $title = $_POST["title"]; ?>
<? $faculty = $_POST["faculty"]; ?>
<? $staffno = $_POST["staffno"]; ?>
<? $teloffice = $_POST["teloffice"]; ?>
<? $telhp = $_POST["telhp"]; ?>
<? $email = $_POST["email"]; ?>
<? $day = $_POST["day"]; ?>
<? $month = $_POST["month"]; ?>
<? $year = $_POST["year"]; ?>
<? $kursusa1 = $_POST["kursusa1"]; ?>
<? $kursusa2 = $_POST["kursusa2"]; ?>
<? $kursusa3 = $_POST["kursusa3"]; ?>
<? $kursusa4 = $_POST["kursusa4"]; ?>
<? $kursusa5 = $_POST["kursusa5"]; ?>
<? $kursusa6 = $_POST["kursusa6"]; ?>
<? $kursusb1 = $_POST["kursusb1"]; ?>
<? $kursusb2 = $_POST["kursusb2"]; ?>
<? $kursusb3 = $_POST["kursusb3"]; ?>
<? $kursusb4 = $_POST["kursusb4"]; ?>
<? $kursusb5 = $_POST["kursusb5"]; ?>
<? $kursusb6 = $_POST["kursusb6"]; ?>
<? $kursusb7 = $_POST["kursusb7"]; ?>
<? $kursusb8 = $_POST["kursusb8"]; ?>
<? $kursusb9 = $_POST["kursusb9"]; ?>
<? $kursusc1 = $_POST["kursusc1"]; ?>
<? $kursusc2 = $_POST["kursusc2"]; ?>
<? $kursusc3 = $_POST["kursusc3"]; ?>
<? $kursusc4 = $_POST["kursusc4"]; ?>
<? $kursusc5 = $_POST["kursusc5"]; ?>
<? $kursusc6 = $_POST["kursusc6"]; ?>
<? $kursusc7 = $_POST["kursusc7"]; ?>
<? $kursusc8 = $_POST["kursusc8"]; ?>
<? $comment = $_POST["comment"]; ?>
<?php
$con = mysql_connect("localhost","root","horatiocsi");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ctlcourse", $con);
mysql_query("INSERT INTO application (name, title, faculty, staffno, teloffice, telhp, email, day, month, year, kursusa1, kursusa2, kursusa3, kursusa4, kursusa5, kursusa6, kursusb1, kursusb2, kursusb3, kursusb4, kursusb5, kursusb6, kursusb7, kursusb8, kursusb9, kursusc1, kursusc2, kursusc3, kursusc4, kursusc5, kursusc6, kursusc7, kursusc8,comment )
VALUES ('$name','$title','$faculty','$staffno','$teloffice','$telhp','$email','$day','$month','$year','$kursusa1','$kursusa2','$kursusa3','$kursusa4','$kursusa5','$kursusa6','$kursusb1','$kursusb2','$kursusb3','$kursusb4','$kursusb5','$kursusb6','$kursusb7','$kursusb8','$kursusb9','$kursusc1','$kursusc2','$kursusc3','$kursusc4','$kursusc5','$kursusc6','$kursusc7','$kursusc8','$comment')");
echo "Thank you for your interest in our course/training modules.";
echo "<br>";
echo "We will contact you to confirm the course/training date.";
echo "<br>";
echo "If you have any questions or need more information, please e-mail or call our office.";
echo "<p><a href=index.htm>Click to go back</a></p>";
mysql_close($con);
?>
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
In your html use:
Now the checked checkboxes values are in an array in the variable $array. Use this php code to read them.
Or you could use a while statement to loop through them.
If you want an expample: go to www.banditssoftball.org/test.php and mess around with that.
Hope it helps
<input type="checkbox" name="array[]" value="1" />
Now the checked checkboxes values are in an array in the variable $array. Use this php code to read them.
<?php
foreach($array as $var) {
//do what you want to with $var
}
?>Or you could use a while statement to loop through them.
If you want an expample: go to www.banditssoftball.org/test.php and mess around with that.
Hope it helps
Last edited by kkeith29 : Sep 20th, 2007 at 12:38 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Windows GUI - problem with dialog box (C++)
- Problem in Default Value of Check Box (JavaScript / DHTML / AJAX)
- tree control view with check box (C#)
- Problem with filesharing on XP home (Windows NT / 2000 / XP / 2003)
- MS Outlook 2003 problem (Windows Software)
- check box (ASP)
- Sorry, another "bridge.dll" problem.. here's my HJT log. (Viruses, Spyware and other Nasties)
- about:blank long lasting problem - Logfile of HijackThis (Viruses, Spyware and other Nasties)
- Spyware Problem and question involving BPS (Viruses, Spyware and other Nasties)
- rundll32.exe problem on shutdown (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: php web stats script
- Next Thread: help!!!!!!!! me wity my php project


Linear Mode