Well I dont want to post the whole code at once (its too many charactors anyway) so ill start with the beginning and stop at the java script that makes sure all the required fields are filled out. If thats okay ill post more.
<?
include("../header.php");
if (!isset($year))
{
$year="19";
}
if (!isset($website))
{
$website="http://";
}
?>
<script language="JavaScript">
<!--
function formCheck(formobj){
//1) Enter name of mandatory fields
var fieldRequired = Array("name" ,"sex","orientation","phone","marital", "email", "day","month","year", "address", "city", "country", "height","weight","measurements", "hair","eyes","travel","photo_type", "experience", "user", "pass", "agree");
//2) Enter field description to appear in the dialog box
var fieldDescription = Array("Name" ,"Sex","Sexual Orientation","Your phone numbers","Marital Status", "E-Mail","Birth day", "Birth month", "Birth year", "Address", "City", "Country","Height", "Weight","Measurements","Hair","Eyes","Travel or not", "Photo type", "Experience", "Username", "Password","You must agree to our terms and conditions if you want to join.");
//3) Enter dialog message
var alertMsg = "Please complete the following fields:\n";
var l_Msg = alertMsg.length;
for (var i = 0; i < fieldRequired.length; i++){
var obj = formobj.elements[fieldRequired[i]];
if (obj){
switch(obj.type){
case "select":
if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
alertMsg += " - " + fieldDescription[i] + "\n";
}
break;
// case "select-multiple":
// if (obj.selectedIndex == -1){
// alertMsg += " - " + fieldDescription[i] + "\n";
// }
// break;
case "text":
case "textarea":
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescription[i] + "\n";
}
break;
default:
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescription[i] + "\n";
}
}
}
}
if (alertMsg.length == l_Msg){
return true;
}else{
alert(alertMsg);
return false;
}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {color: #00FFFF}
.style2 {color: #64adde}
-->
</style>