I tried your code by itself and that worked, but when trying to port it over to my code, it did not work. I was wondering if you could take a look at my code and show me how to implement it properly to atleast one textbox, then I can get everything else working myself. Below is my code, I took everything to do with your post out so it isn't in the way. I also had to take out some functions so that it would fit in here (only allowed 10000 chars).
Sorry if my code is kinda messy, I was constantly learning php throughout this whole page.
<?php
error_reporting(E_ALL);
if (isset($_POST['f_AddPersonnelButton']))
{
AddPersonnel();
}
else if (isset($_POST['f_AddOSButton']))
AddOS();
else if (isset($_POST['f_AddApplicationSoftwareButton']))
AddApplicationSoftware();
else if (isset($_POST['f_AddDatabaseSoftwareButton']))
AddDatabaseSoftware();
else if (isset($_POST['f_AddProject']))
AddProject();
else
Main();
function Main()
{
print "<html>";
print "<head>";
print "<title>R+D Project Form</title>";
print "<script language=javascript type=text/javascript src=datetimepicker.js>";
print "</script>";
print "</head>";
print "<body background=RDProjectBackground.jpg>";
print "<center><table border=0 cellpadding=0 cellspacing=0>";
print "<tr>";
print "<td colspan=3 width=600 bgcolor=#336699><center><a href=\"RDProjectMain.php\"><img src=\"RDProjectHeader.jpg\" border=0/></a></center></td>";
print "</tr>";
print "<tr>";
print "<td width=25 bgcolor=#336699></td>";
print "<td width=550 bgcolor=#FFFFFF>";
//Layout Body Starts Here
print "<form action=\"RDProjectForm.php\" method=post>\n";
print "<fieldset>";
print "<legend><b>Project Information</b></legend>";
print "<font color=#336699>";
print "<!-Sponsor Project or Business Area Question-------------------------------------->";
print " <p>";
print " <b>Sponsor Project or Business Area</b><br />";
print " <i>(Name of the sponsor project or the business area)</i><br />";
print ' <input type=text name=f_sponsorProjectOrBusinessArea size=60 maxlength=60 value="';
if (isset($f_sponsorProjectOrBusinessArea))
{
print $f_sponsorProjectOrBusinessArea;
}
print '">';
print " </p>";
print "<!-Contact Name Question---------------------------------------------------------->";
print " <p>";
print " <b>Contact Name</b><br />";
print " <i>(Name of the project's contact)</i><br />";
print " <input type=text name=f_contactName size=60 maxlength=60>";
print " </p>";
print "<!-R+D Deliverables Question------------------------------------------------------>";
print " <p>";
print " <b>R+D Deliverables</b><br />";
print " <i>(Describe the project in detail)</i><br /> ";
print " <textarea name=f_RDDeliverables cols=45 rows=5 wrap=virtual></textarea>";
print " </p>";
print "<!-R+D Personnel Assigned Question------------------------------------------------>";
print " <p>";
print " <b>R+D Personnel Assigned</b><br />";
print " <i>(Hold down the Ctrl key to select multiple options or deselect an option)</i><br />";
PopulatePersonnelListbox();
print " </p>";
print "<!-Requesting R+D Sponsor Area Question---------------------------------------------------->";
print " <p>";
print " <b>Requesting R+D Sponsor Area</b><br />";
print " <i>(Title of requesting R+D Sponsor Area developing the project)</i><br /> ";
print " <input type=text name=f_developmentBranch size=60 maxlength=60>";
print " </p>";
print "<!-Projected R+D Timeline Question----------------------------------------------->";
print " <p>";
print " <b>Projected R+D Timeline</b><br />";
print " <i>(Enter dates when development starts and ends)</i><br /> ";
print " Start Date <input name=f_startDate id=startDate type=text size=25><a href=javascript:NewCal('startDate','ddmmyyyy')><img src=cal.gif width=16 height=16 border=0 alt=Pick a date></a>";
print " End Date <input name=f_endDate id=endDate type=text size=25><a href=javascript:NewCal('endDate','ddmmyyyy')><img src=cal.gif width=16 height=16 border=0 alt=Pick a date></a>";
print " </p></font>";
print "</fieldset>";
print "<fieldset>";
print "<legend><b>HSCRDL Resources Reserved</b></legend>";
print "<font color=#336699>";
print "<!-Host Machine Question----------------------------------------------------------->";
print " <p>";
print " <b>Host Machine</b><br />";
print " <i>(The name of the machine hosting the project.)</i><br /> ";
print " <input type=text name=f_machineName size=60 maxlength=60>";
print " </p>";
print "<!-Host IP------------------------------------------------------------->";
print " <p>";
print " <b>Host Machine's IP</b><br />";
print " <i>(The IP address the project is located on.)</i><br /> ";
print " <input type=text name=f_machineIP size=20 maxlength=20>";
print " </p>";
print "<!-Operating System Question------------------------------------------------------>";
print " <p>";
print " <b>Operating System</b><br />";
print " <i>(Hold down the Ctrl key to select multiple options or deselect an option)</i><br />";
PopulateOSListbox();
print " </p>";
print "<!-Application Software Question------------------------------------------------------------->";
print " <p>";
print " <b>Application Software</b><br />";
print " <i>(Hold down the Ctrl key to select multiple options or deselect an option)</i><br />";
PopulateApplicationSoftwareListbox();
print " </p>";
print "<!-Database Software Question------------------------------------------------------------->";
print " <p>";
print " <b>Database Software</b><br />";
print " <i>(Hold down the Ctrl key to select multiple options or deselect an option)</i><br />";
PopulateDatabaseSoftwareListbox();
print " </p>";
print "<!-HSCRDL AD Accounts Assigned Question----------------------------------------------------->";
print " <p>";
print " <b>HSCRDL AD Accounts Assigned</b><br />";
print " <i>(Check if HSCRDL AD Accounts Assigned)</i><br />";
print " <input type=checkbox name=f_ADAccountsAssigned value=True />Allow Remote Access";
print " </p>";
print "<!-Additional Requirements------------------------------------------------------->";
print " <p>";
print " <b>Additional Requirements</b><br />";
print " <i>(Add any other requiremments that are not listed above)</i><br />";
print " <textarea name=f_additionalRequirements cols=50 rows=6 wrap=virtual></textarea>";
print " </p></font>";
print "</fieldset>";
print "<!-Form Buttons------------------------------------------------------------------>";
print " <center><input type=submit name=\"f_AddProject\" value=\"Add Project\">\n";
print " <input type=reset value=Clear></center>";
print " </form>";
//Layout Body Ends Here
print "</td>";
print "<td width=25 bgcolor=#336699></td>";
print "</tr>";
print "<tr>";
print "<td width=550 bgcolor=#336699 colspan=3><center><font color=#FFFFFF size=2>For R+D Project Form support email <a href=\"mailto:james.seymour@moh.gov.on.ca\">James Seymour</a>.</font></center></td>";
print "</tr>";
print "</table></center>";
print "</body>";
print "</html>";
}
//****************************************************************************
//This function populates the personnel listbox
//****************************************************************************
function PopulatePersonnelListbox()
{
$link = mysql_connect("localhost", "root", "ou812");
mysql_select_db("rdprojects");
$query = "SELECT Personnel FROM personnelassigned order by Personnel";
$queryresult = mysql_query($query);
print "<SELECT multiple=multiple size=5 name=personnelAssignedListBox[]>";
while ($row = mysql_fetch_array($queryresult))
{
print "<OPTION value='$row[Personnel]'";
print ">$row[Personnel]</OPTION>";
}
mysql_close($link);
print "</SELECT>\n\n";
print "<input type=text size=20 name=f_AddPersonnelText value=>\n";
print "<input type=submit name=\"f_AddPersonnelButton\" value=\"Add Personnel\">\n";
}
//****************************************************************************
//This function adds an item to the personnel listbox, then updates the listbox
//****************************************************************************
function AddPersonnel()
{
$link = mysql_connect("localhost", "root", "ou812");
mysql_select_db("rdprojects");
$Query=("Select * from personnelassigned descending order by IDNum");
$QueryResults=(mysql_query($Query));
while ($row=mysql_fetch_array($QueryResults))
{
$counter++;
}
$counter++;
$AddPersonnel = $_POST['f_AddPersonnelText'];
if (!empty($AddPersonnel))
{
$sql = "INSERT INTO personnelassigned SET IDnum=$counter, Personnel='$AddPersonnel'";
mysql_query($sql);
}
mysql_close($link);
Main();
}
Thanks for any help you can give.