// check if the page is called for the first time if (!$choice) { //generate the header of the main page GenerateHTMLHeader("Click below to access the address Book"); //generate the main page GenerateFrontPage(); } else { if ($choice == "Search Address Book") { GenerateHTMLHeader("Search using the following criteria:"); //generate an HTML form containing a submit button with value "SEARCH" and action script //as search.php GenerateHTMLForm(0, "search.php", "SEARCH"); } else { if ($choice == "Add a New Entry") { GenerateHTMLHeader("Please fill in fields : Name and Email mandatory"); GenerateHTMLForm(0, "add.php", "ADD ENTRY"); } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> </body> </html>
exit; } //Generate the html header with message "please modify fields" GenerateHTMLHeader("please modify fields"); // display the result of the search if (!($row = mysql_fetch_object($result))) { DisplayErrMsg("Internal error: the entry does not exist"); exit; } $resultEntry["cn"] = $row->name; $resultEntry["mail"] = $row->email; $resultEntry["locality"] = $row->city; $resultEntry["description"] = $row->description; $resultEntry["telephonenumber"] = $row->telephone; //generate html form GenerateHTMLForm($resultEntry, "update.php?rowid={$rowid}", "MODIFY"); mysql_free_result($result); //free the memory associated with $result variable. mysql_free_result($result); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> </body> </html>