jkkenzie Posted July 15, 2008 Share Posted July 15, 2008 Is there a way i can make the below text boxes to display as list box i.e <option></option> getting records from database? full code below.. <?php $row = array( "Receipt Number" => "", "Title" => "", "First Name" => "", "Middle Name" => "", "Last Name" => "", "Reg Fees" => "", "Date Registered" => "", "ID Number" => "", "Y O B" => "", "Home District" => "", "Telephone" => "", "Cell Phone" => "", "Address" => "", "E-mail" => "", "Receipt Issued" => "", "ID" => "", "Gender" => "", "Occupation" => "", "Employer" => "", "Division" => "", "Location" => "", "SubLocation" => "", "Country" => "", "Country Of Residence" => "", "Form Of Payment" => "", "Bank" => "", "Current Residence" => ""); showroweditor($row, false); ?> the full code is here: <html> <head> <title>emobase -- members</title> <meta name="generator" http-equiv="content-type" content="text/html"> ///style is here </head> <body> <?php $conn = connect(); $showrecs = 20; $pagerange = 10; $a = @$_GET["a"]; $recid = @$_GET["recid"]; $page = @$_GET["page"]; if (!isset($page)) $page = 1; $sql = @$_POST["sql"]; switch ($sql) { case "insert": sql_insert(); break; case "update": sql_update(); break; case "delete": sql_delete(); break; } switch ($a) { case "add": addrec(); break; case "view": viewrec($recid); break; case "edit": editrec($recid); break; case "del": deleterec($recid); break; default: select(); break; } if (isset($order)) $_SESSION["order"] = $order; if (isset($ordtype)) $_SESSION["type"] = $ordtype; if (isset($filter)) $_SESSION["filter"] = $filter; if (isset($filterfield)) $_SESSION["filter_field"] = $filterfield; if (isset($wholeonly)) $_SESSION["wholeonly"] = $wholeonly; mysql_close($conn); ?> </td></tr></table> <table class="bd" width="100%"><tr><td class="hr"><a href="http://www.emosociety.org">Visit EMO Site for current events</a></td></tr></table> </body> </html> <?php function select() { global $a; global $showrecs; global $page; global $filter; global $filterfield; global $wholeonly; global $order; global $ordtype; if ($a == "reset") { $filter = ""; $filterfield = ""; $wholeonly = ""; $order = ""; $ordtype = ""; } $checkstr = ""; if ($wholeonly) $checkstr = " checked"; if ($ordtype == "asc") { $ordtypestr = "desc"; } else { $ordtypestr = "asc"; } $res = sql_select(); $count = sql_getrecordcount(); if ($count % $showrecs != 0) { $pagecount = intval($count / $showrecs) + 1; } else { $pagecount = intval($count / $showrecs); } $startrec = $showrecs * ($page - 1); if ($startrec < $count) {mysql_data_seek($res, $startrec);} $reccount = min($showrecs * $page, $count); ?> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr><td>Table: members</td></tr> <tr><td>Records shown <?php echo $startrec + 1 ?> - <?php echo $reccount ?> of <?php echo $count ?></td></tr> </table> <hr size="1" noshade> <form action="index.php" method="post"> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><b>Custom Search</b> </td> <td><input type="text" name="filter" value="<?php echo $filter ?>"></td> <td><select name="filter_field"> <option value="">All Fields</option> <option value="<?php echo "Receipt Number" ?>"<?php if ($filterfield == "Receipt Number") { echo "selected"; } ?>><?php echo htmlspecialchars("Receipt Number") ?></option> <option value="<?php echo "Title" ?>"<?php if ($filterfield == "Title") { echo "selected"; } ?>><?php echo htmlspecialchars("Title") ?></option> <option value="<?php echo "First Name" ?>"<?php if ($filterfield == "First Name") { echo "selected"; } ?>><?php echo htmlspecialchars("First Name") ?></option> <option value="<?php echo "Middle Name" ?>"<?php if ($filterfield == "Middle Name") { echo "selected"; } ?>><?php echo htmlspecialchars("Middle Name") ?></option> <option value="<?php echo "Last Name" ?>"<?php if ($filterfield == "Last Name") { echo "selected"; } ?>><?php echo htmlspecialchars("Last Name") ?></option> <option value="<?php echo "Reg Fees" ?>"<?php if ($filterfield == "Reg Fees") { echo "selected"; } ?>><?php echo htmlspecialchars("Reg Fees") ?></option> <option value="<?php echo "Date Registered" ?>"<?php if ($filterfield == "Date Registered") { echo "selected"; } ?>><?php echo htmlspecialchars("Date Registered") ?></option> <option value="<?php echo "ID Number" ?>"<?php if ($filterfield == "ID Number") { echo "selected"; } ?>><?php echo htmlspecialchars("ID Number") ?></option> <option value="<?php echo "Y O B" ?>"<?php if ($filterfield == "Y O B") { echo "selected"; } ?>><?php echo htmlspecialchars("Y O B") ?></option> <option value="<?php echo "Home District" ?>"<?php if ($filterfield == "Home District") { echo "selected"; } ?>><?php echo htmlspecialchars("Home District") ?></option> <option value="<?php echo "Telephone" ?>"<?php if ($filterfield == "Telephone") { echo "selected"; } ?>><?php echo htmlspecialchars("Telephone") ?></option> <option value="<?php echo "Cell Phone" ?>"<?php if ($filterfield == "Cell Phone") { echo "selected"; } ?>><?php echo htmlspecialchars("Cell Phone") ?></option> <option value="<?php echo "Address" ?>"<?php if ($filterfield == "Address") { echo "selected"; } ?>><?php echo htmlspecialchars("Address") ?></option> <option value="<?php echo "E-mail" ?>"<?php if ($filterfield == "E-mail") { echo "selected"; } ?>><?php echo htmlspecialchars("E-mail") ?></option> <option value="<?php echo "Receipt Issued" ?>"<?php if ($filterfield == "Receipt Issued") { echo "selected"; } ?>><?php echo htmlspecialchars("Receipt Issued") ?></option> <option value="<?php echo "Gender" ?>"<?php if ($filterfield == "Gender") { echo "selected"; } ?>><?php echo htmlspecialchars("Gender") ?></option> <option value="<?php echo "Occupation" ?>"<?php if ($filterfield == "Occupation") { echo "selected"; } ?>><?php echo htmlspecialchars("Occupation") ?></option> <option value="<?php echo "Employer" ?>"<?php if ($filterfield == "Employer") { echo "selected"; } ?>><?php echo htmlspecialchars("Employer") ?></option> <option value="<?php echo "Division" ?>"<?php if ($filterfield == "Division") { echo "selected"; } ?>><?php echo htmlspecialchars("Division") ?></option> <option value="<?php echo "Location" ?>"<?php if ($filterfield == "Location") { echo "selected"; } ?>><?php echo htmlspecialchars("Location") ?></option> <option value="<?php echo "SubLocation" ?>"<?php if ($filterfield == "SubLocation") { echo "selected"; } ?>><?php echo htmlspecialchars("SubLocation") ?></option> <option value="<?php echo "Country" ?>"<?php if ($filterfield == "Country") { echo "selected"; } ?>><?php echo htmlspecialchars("Country") ?></option> <option value="<?php echo "Country Of Residence" ?>"<?php if ($filterfield == "Country Of Residence") { echo "selected"; } ?>><?php echo htmlspecialchars("Country Of Residence") ?></option> <option value="<?php echo "Form Of Payment" ?>"<?php if ($filterfield == "Form Of Payment") { echo "selected"; } ?>><?php echo htmlspecialchars("Form Of Payment") ?></option> <option value="<?php echo "Bank" ?>"<?php if ($filterfield == "Bank") { echo "selected"; } ?>><?php echo htmlspecialchars("Bank") ?></option> <option value="<?php echo "Current Residence" ?>"<?php if ($filterfield == "Current Residence") { echo "selected"; } ?>><?php echo htmlspecialchars("Current Residence") ?></option> </select></td> <td><input type="checkbox" name="wholeonly"<?php echo $checkstr ?>>Whole words only</td> </td></tr> <tr> <td> </td> <td><input type="submit" name="action" value="Search"></td> <td><a href="index.php?a=reset">Reset</a></td> </tr> </table> </form> <hr size="1" noshade> <?php showpagenav($page, $pagecount); ?> <br> <table class="tbl" border="0" cellspacing="1" cellpadding="3"width="100%"> <tr> <td class="hr"> </td> <td class="hr"> </td> <td class="hr"> </td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Receipt Number" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Receipt Number") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Title" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Title") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "First Name" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("First Name") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Middle Name" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Middle Name") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Last Name" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Last Name") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Reg Fees" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Reg Fees") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Date Registered" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Date Registered") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "ID Number" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("ID Number") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Y O B" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Y O B") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Home District" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Home District") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Telephone" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Telephone") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Cell Phone" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Cell Phone") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Address" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Address") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "E-mail" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("E-mail") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Receipt Issued" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Receipt Issued") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Gender" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Gender") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Occupation" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Occupation") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Employer" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Employer") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Division" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Division") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Location" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Location") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "SubLocation" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("SubLocation") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Country" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Country") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Country Of Residence" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Country Of Residence") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Form Of Payment" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Form Of Payment") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Bank" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Bank") ?></a></td> <td class="hr"><a class="hr" href="index.php?order=<?php echo "Current Residence" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("Current Residence") ?></a></td> </tr> <?php for ($i = $startrec; $i < $reccount; $i++) { $row = mysql_fetch_assoc($res); $style = "dr"; if ($i % 2 != 0) { $style = "sr"; } ?> <tr> <td class="<?php echo $style ?>"><a href="index.php?a=view&recid=<?php echo $i ?>">VIEW</a></td> <td class="<?php echo $style ?>"><a href="index.php?a=edit&recid=<?php echo $i ?>">EDIT</a></td> <td class="<?php echo $style ?>"><a href="index.php?a=del&recid=<?php echo $i ?>">DELETE</a></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Receipt Number"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Title"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["First Name"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Middle Name"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Last Name"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Reg Fees"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Date Registered"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["ID Number"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Y O B"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Home District"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Telephone"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Cell Phone"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Address"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["E-mail"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Receipt Issued"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Gender"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Occupation"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Employer"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Division"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Location"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["SubLocation"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Country"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Country Of Residence"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Form Of Payment"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Bank"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["Current Residence"]) ?></td> </tr> <?php } mysql_free_result($res); ?> </table> <br> <?php showpagenav($page, $pagecount); ?> <?php } ?> <?php function login() { global $_POST; global $_SESSION; global $_GET; if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false; if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false; if (!$_SESSION["logged_in"]) { $login = ""; $password = ""; if (isset($_POST["login"])) $login = @$_POST["login"]; if (isset($_POST["password"])) $password = @$_POST["password"]; if (($login != "") && ($password != "")) { $conn = mysql_connect("localhost", "root", ""); mysql_select_db("emobase"); $sql = "select `password` from `emo_users` where `username` = '" .$login ."'"; $res = mysql_query($sql, $conn) or die(mysql_error()); $row = mysql_fetch_assoc($res) or $row = array(0 => "");; if (isset($row)) reset($row); if (isset($password) && ($password == trim(current($row)))) { $_SESSION["logged_in"] = true; } else { ?> <p><b><font color="-1">Sorry, the login/password combination you've entered is invalid</font></b></p> <?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?> <form action="index.php" method="post"> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <br><br><br><br> <tr> <td width="40%"></td><td>LOGIN</td> <td><input type="text" name="login" value="<?php echo $login ?>"></td> </tr> <tr> <td width="40%"></td><td>PASSWORD</td> <td><input type="password" name="password" value="<?php echo $password ?>"></td> </tr> <tr> <td width="40%"></td><td><input type="submit" name="action" value="LOGIN"></td> </tr> </table> </form> <?php } if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false; return $_SESSION["logged_in"]; } ?> <?php function showrow($row, $recid) { ?> <table class="tbl" border="0" cellspacing="1" cellpadding="3"width="50%"> <tr> <td class="hr"><?php echo htmlspecialchars("Receipt Number")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Receipt Number"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Title")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Title"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("First Name")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["First Name"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Middle Name")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Middle Name"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Last Name")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Last Name"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Reg Fees")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Reg Fees"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Date Registered")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Date Registered"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("ID Number")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["ID Number"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Y O B")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Y O B"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Home District")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Home District"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Telephone")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Telephone"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Cell Phone")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Cell Phone"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Address")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Address"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("E-mail")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["E-mail"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Receipt Issued")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Receipt Issued"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Gender")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Gender"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Occupation")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Occupation"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Employer")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Employer"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Division")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Division"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Location")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Location"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("SubLocation")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["SubLocation"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Country")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Country"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Country Of Residence")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Country Of Residence"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Form Of Payment")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Form Of Payment"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Bank")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Bank"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Current Residence")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["Current Residence"]) ?></td> </tr> </table> <?php } ?> <?php function showroweditor($row, $iseditmode) { global $conn; ?> <table class="tbl" border="0" cellspacing="1" cellpadding="3"width="50%"> <tr> <td class="hr"><?php echo htmlspecialchars("Receipt Number")." " ?></td> <td class="dr"><input type="text" name="Receipt_Number" value="<?php echo str_replace('"', '"', trim($row["Receipt Number"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Title")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Title" maxlength="255"><?php echo str_replace('"', '"', trim($row["Title"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("First Name")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="First_Name" maxlength="255"><?php echo str_replace('"', '"', trim($row["First Name"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Middle Name")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Middle_Name" maxlength="255"><?php echo str_replace('"', '"', trim($row["Middle Name"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Last Name")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Last_Name" maxlength="255"><?php echo str_replace('"', '"', trim($row["Last Name"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Reg Fees")." " ?></td> <td class="dr"><input type="text" name="Reg_Fees" value="<?php echo str_replace('"', '"', trim($row["Reg Fees"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Date Registered")." " ?></td> <td class="dr"><input type="text" name="Date_Registered" value="<?php echo str_replace('"', '"', trim($row["Date Registered"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("ID Number")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="ID_Number" maxlength="255"><?php echo str_replace('"', '"', trim($row["ID Number"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Y O B")." " ?></td> <td class="dr"><input type="text" name="Y_O_B" maxlength="50" value="<?php echo str_replace('"', '"', trim($row["Y O B"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Home District")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Home_District" maxlength="255"><?php echo str_replace('"', '"', trim($row["Home District"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Telephone")." " ?></td> <td class="dr"><input type="text" name="Telephone" maxlength="50" value="<?php echo str_replace('"', '"', trim($row["Telephone"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Cell Phone")." " ?></td> <td class="dr"><input type="text" name="Cell_Phone" maxlength="50" value="<?php echo str_replace('"', '"', trim($row["Cell Phone"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Address")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Address" maxlength="255"><?php echo str_replace('"', '"', trim($row["Address"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("E-mail")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="E-mail" maxlength="255"><?php echo str_replace('"', '"', trim($row["E-mail"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Receipt Issued")." " ?></td> <td class="dr"><input type="text" name="Receipt_Issued" value="<?php echo str_replace('"', '"', trim($row["Receipt Issued"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Gender")." " ?></td> <td class="dr"><input type="text" name="Gender" value="<?php echo str_replace('"', '"', trim($row["Gender"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Occupation")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Occupation" maxlength="50"><?php echo str_replace('"', '"', trim($row["Occupation"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Employer")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Employer" maxlength="255"><?php echo str_replace('"', '"', trim($row["Employer"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Division")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Division" maxlength="255"><?php echo str_replace('"', '"', trim($row["Division"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Location")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="Location" maxlength="255"><?php echo str_replace('"', '"', trim($row["Location"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("SubLocation")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="SubLocation" maxlength="255"><?php echo str_replace('"', '"', trim($row["SubLocation"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Country")." " ?></td> <td class="dr"><input type="text" name="Country" maxlength="255" value="<?php echo str_replace('"', '"', trim($row["Country"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Country Of Residence")." " ?></td> <td class="dr"><input type="text" name="Country_Of_Residence" maxlength="50" value="<?php echo str_replace('"', '"', trim($row["Country Of Residence"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Form Of Payment")." " ?></td> <td class="dr"><input type="text" name="Form_Of_Payment" maxlength="50" value="<?php echo str_replace('"', '"', trim($row["Form Of Payment"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Bank")." " ?></td> <td class="dr"><input type="text" name="Bank" maxlength="50" value="<?php echo str_replace('"', '"', trim($row["Bank"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("Current Residence")." " ?></td> <td class="dr"><input type="text" name="Current_Residence" maxlength="50" value="<?php echo str_replace('"', '"', trim($row["Current Residence"])) ?>"></td> </tr> </table> <?php } ?> <?php function showpagenav($page, $pagecount) { ?> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><a href="index.php?a=add">ADD</a> </td> <?php if ($page > 1) { ?> <td><a href="index.php?page=<?php echo $page - 1 ?>"><< PREVIOUS</a> </td> <?php } ?> <?php global $pagerange; if ($pagecount > 1) { if ($pagecount % $pagerange != 0) { $rangecount = intval($pagecount / $pagerange) + 1; } else { $rangecount = intval($pagecount / $pagerange); } for ($i = 1; $i < $rangecount + 1; $i++) { $startpage = (($i - 1) * $pagerange) + 1; $count = min($i * $pagerange, $pagecount); if ((($page >= $startpage) && ($page <= ($i * $pagerange)))) { for ($j = $startpage; $j < $count + 1; $j++) { if ($j == $page) { ?> <td><b><?php echo $j ?></b></td> <?php } else { ?> <td><a href="index.php?page=<?php echo $j ?>"><?php echo $j ?></a></td> <?php } } } else { ?> <td><a href="index.php?page=<?php echo $startpage ?>"><?php echo $startpage ."..." .$count ?></a></td> <?php } } } ?> <?php if ($page < $pagecount) { ?> <td> <a href="index.php?page=<?php echo $page + 1 ?>">NEXT >></a> </td> <?php } ?> </tr> </table> <?php } ?> <?php function showrecnav($a, $recid, $count) { ?> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><a href="index.php">HOME</a></td> <?php if ($recid > 0) { ?> <td><a href="index.php?a=<?php echo $a ?>&recid=<?php echo $recid - 1 ?>">PREVIOUS</a></td> <?php } if ($recid < $count - 1) { ?> <td><a href="index.php?a=<?php echo $a ?>&recid=<?php echo $recid + 1 ?>">NEXT</a></td> <?php } ?> </tr> </table> <hr size="1" noshade> <?php } ?> <?php function addrec() { ?> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><a href="index.php">HOME</a></td> </tr> </table> <hr size="1" noshade> <form enctype="multipart/form-data" action="index.php" method="post"> <p><input type="hidden" name="sql" value="insert"></p> <?php $row = array( "Receipt Number" => "", "Title" => "", "First Name" => "", "Middle Name" => "", "Last Name" => "", "Reg Fees" => "", "Date Registered" => "", "ID Number" => "", "Y O B" => "", "Home District" => "", "Telephone" => "", "Cell Phone" => "", "Address" => "", "E-mail" => "", "Receipt Issued" => "", "ID" => "", "Gender" => "", "Occupation" => "", "Employer" => "", "Division" => "", "Location" => "", "SubLocation" => "", "Country" => "", "Country Of Residence" => "", "Form Of Payment" => "", "Bank" => "", "Current Residence" => ""); showroweditor($row, false); ?> <p><input type="submit" name="action" value="SAVE"></p> </form> <?php } ?> <?php function viewrec($recid) { $res = sql_select(); $count = sql_getrecordcount(); mysql_data_seek($res, $recid); $row = mysql_fetch_assoc($res); showrecnav("view", $recid, $count); ?> <br> <?php showrow($row, $recid) ?> <br> <hr size="1" noshade> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><a href="index.php?a=add">ADD</a></td> <td><a href="index.php?a=edit&recid=<?php echo $recid ?>">EDIT</a></td> <td><a href="index.php?a=del&recid=<?php echo $recid ?>">DELETE</a></td> </tr> </table> <?php mysql_free_result($res); } ?> <?php function connect() { $conn = mysql_connect("localhost", "root", ""); mysql_select_db("emobase"); return $conn; } Link to comment https://forums.phpfreaks.com/topic/114799-solved-array-plus-text-box-plus-list-box/ Share on other sites More sharing options...
MadTechie Posted July 15, 2008 Share Posted July 15, 2008 yes, just echo the html ie $sel = ($filterfield == $row['field']) "selected":""; echo "<option value=\"{$row['field']}\" $sel>".htmlspecialchars($row['field'])."</option>"; Link to comment https://forums.phpfreaks.com/topic/114799-solved-array-plus-text-box-plus-list-box/#findComment-590434 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.