Functions being show at the top of the page.
Posted: Thu Feb 03, 2011 1:43 pm
So this is the code I have:
But this is what is happening?

Code: Select all
<?php
/**
* Description of registerClass
*
* @author Dominic Sore
*/
class registerClass {
public function getPlatform(){
$result = mysql_query('SELECT * FROM sys_platform') OR die(mysql_error());
$template = mysql_fetch_array($result) OR die(mysql_error());
}
public function incCountries(){
include_once(TPATH_BASE.DS.'components'.DS.'componentControllers'.DS.'register'.DS.'registerCountries.php');
}
public function dobFunc(){
$Tyear = date(Y);
$year = $Tyear - 18;
echo '<select id="user_dob" name="user_dob">';
for($i=0; $i<=80; $i++){
echo '<option value="'.$year.'">'.$year.'</option>';
$year = $year - 1;
}
echo '</select>';
}
public function startForm(){
echo '<form action="<?php echo $_SERVER[\'PHP_SELF\']; ?>" method="post" enctype="multipart/form-data" name="register">';
}
public function endForm(){
echo '</form>';
}
public function createPersonal(){
echo '<div id="inner_box">
<div id="inner_header">Personal Info</div>
<div id="inner_content">
<table width="300" border="0">
<tr>
<td width="121">First Name:</td>
<td width="195">
<input type="text" name="user_fname" id="user_fname" />
</td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" name="user_lname" id="user_lname" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="user_email" id="user_email" /></td>
</tr>
<tr>
<td>Confirm Email:</td>
<td><input type="text" name="user_cemail" id="user_cemail" /></td>
</tr>
<tr>
<td>Gender:</td>
<td>
<select name="user_gender" id="user_gender">
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</td>
</tr>
<tr>
<td>Birth Year:</td>
<td>'.$this->dobFunc().'</td>
</tr>
<tr>
<td>Street Address:</td>
<td><input type="text" name="user_street" id="user_street" /></td>
</tr>
<tr>
<td>City:</td>
<td><input type="text" name="user_city" id="user_city" /></td>
</tr>
<tr>
<td>Country:</td>
<td>'.$this->incCountries().'</td>
</tr>
<tr>
<td>Post Code:</td>
<td><input type="text" name="user_pcode" id="user_pcode" /></td>
</tr>
</table>
</div>
</div>';
}
}
?>