I am fairly new to PHP and have found an example from a book that seems to work fine. In the example, on the main page, I have few Buttons, if you click on the Button, it calls a function and you see a form ready to be filled with data.
I extended that example, and now I have more Buttons on my home page. Indeed, all I have on the home page now, is just buttons, which does not look pretty. I wish to change the bottons to links or drop down menue so that I can make them look better. However, with the way it is programmed and with my limited capability, I have not been able to figure out how to do that. Therefore, I would highly appreciate if someone can help me. Here is the part of code.
//main.php
// Check if the page is called for the first time
if (!$choice){
GenerateHTMLHeader("Click below to access the Car database");
GenerateFrontPage();
} //if
else if ($choice == "Search The Database"){
header("Location:search.php");
} //else if
else if ($choice == "Add a New Entry"){
GenerateHTMLHeader( "Please fill in the following fields to add a new entry:" );
GenerateHTMLForm(0, "add.php", "ADD ENTRY ") ;
} //else if
//common.php
// Generate the HTML form for add/modify/search
function GenerateHTMLForm($formValues, $actionScript, $submitLabel) {
printf("<FORM METHOD=post enctype= \"multipart/form-data\" ACTION=\"%s\"><PRE>\n", $actionScript);
printf("Price: <INPUT TYPE=text SIZE=35 NAME=car_price VALUE=\"%s\">
<BR>\n", ($formValues) ? $formValues["car_price"] : "");
printf("Year: <INPUT TYPE=text SIZE=35 NAME=car_year VALUE=\"%s\">
<BR>\n", ($formValues) ? $formValues["car_year"] : "");
printf("Make: <INPUT TYPE=text SIZE=35 NAME=car_make VALUE=\"%s\">
<BR>\n", ($formValues) ? $formValues["car_make"] : "");
printf("Model: <INPUT TYPE=text SIZE=35 NAME=car_model VALUE=\"%s\">
<BR>\n", ($formValues) ? $formValues["car_model"] : "");
printf("Kilometers: <INPUT TYPE=text SIZE=35 NAME=car_kilometers VALUE=\"%s\">
<BR>\n", ($formValues) ? $formValues["car_kilometers"] : "");
printf("Detail:
<TEXTAREA cols=\"30\" rows=\"5\" Name=car_details>%s</TEXTAREA>
<BR>\n", ($formValues) ? $formValues["car_details"] : "");
printf("Select File: <input type=file name=userfile value=\"s\">
<BR>\n", ($formValues) ? $formValues["userfile"]:"");
printf("<INPUT TYPE=submit VALUE=\"%s\">", $submitLabel );
printf("</PRE></FORM>" );
}//GenerateHTMLForm
Please Help!