require "config.php"; ?>
//use $id,$lange
$id = $HTTP_GET_VARS['id'];
$lange = $HTTP_GET_VARS['lange'];
// connect database
mysql_connect($host,$username,$password) or die ("Can't connect database.");
mysql_select_db($database) or die("Can't select database.");
# get row of topic
$result = mysql_db_query($database,"select * from $table_people where id=$id") or die("Can't select table1 [ table = $table_people ] [ id = $id ].");
$row=mysql_fetch_array($result);
// check empty
if ($row[expertise] == "") $row[expertise] = "(Not avaliable)";
if ($row[expertise_th] == "") $row[expertise_th] = "(Not avaliable)";
if ($row[research] == "") $row[research] = "(Not avaliable)";
if ($row[research_th] == "") $row[research_th] = "(Not avaliable)";
if ($row[work_experiences] == "") $row[work_experiences] = "(Not avaliable)";
if ($row[work_experiences_th] == "") $row[work_experiences_th] = "(Not avaliable)";
if ($row[publications] == "") $row[publications] = "(Not avaliable)";
if ($row[publications_th] == "") $row[publications_th] = "(Not avaliable)";
// replace char
$row[name] = htmlspecialchars($row[name]);
$row[name_th] = htmlspecialchars($row[name_th]);
$row[title] = htmlspecialchars($row[title]);
$row[title_th] = htmlspecialchars($row[title_th]);
$row[office] = htmlspecialchars($row[office]);
$row[office_th] = htmlspecialchars($row[office_th]);
$row[tel] = htmlspecialchars($row[tel]);
$row[email] = htmlspecialchars($row[email]);
$row[homepage] = htmlspecialchars($row[homepage]);
$row[qualifications] = htmlspecialchars($row[qualifications]);
$row[qualifications_th] = htmlspecialchars($row[qualifications_th]);
$row[expertise] = htmlspecialchars($row[expertise]);
$row[expertise_th] = htmlspecialchars($row[expertise_th]);
$row[research] = htmlspecialchars($row[research]);
$row[research_th] = htmlspecialchars($row[research_th]);
$row[work_experiences] = htmlspecialchars($row[work_experiences]);
$row[work_experiences_th] = htmlspecialchars($row[work_experiences_th]);
$row[publications] = htmlspecialchars($row[publications]);
$row[publications_th] = htmlspecialchars($row[publications_th]);
$row[position] = htmlspecialchars($row[position]);
$row[position_th] = htmlspecialchars($row[position_th]);
//echo "Replace Char: $";
$row[name] = replace_str($row[name]);
$row[name_th] = replace_str($row[name_th]);
$row[title] = replace_str($row[title]);
$row[title_th] = replace_str($row[title_th]);
$row[office] = replace_str($row[office]);
$row[office_th] = replace_str($row[office_th]);
$row[tel] = replace_str($row[tel]);
$row[email] = replace_str($row[email]);
$row[homepage] = replace_str($row[homepage]);
$row[qualifications] = replace_str($row[qualifications]);
$row[qualifications_th] = replace_str($row[qualifications_th]);
$row[expertise] = replace_str($row[expertise]);
$row[expertise_th] = replace_str($row[expertise_th]);
$row[research] = replace_str($row[research]);
$row[research_th] = replace_str($row[research_th]);
$row[work_experiences] = replace_str($row[work_experiences]);
$row[work_experiences_th] = replace_str($row[work_experiences_th]);
$row[publications]= replace_str($row[publications]);
$row[publications_th] = replace_str($row[publications_th]);
$row[position] = replace_str($row[position]);
$row[position_th] = replace_str($row[position_th]);
function replace_str($exp)
{
$exp = ereg_replace("\n","
",$exp);
$exp = ereg_replace(" "," ",$exp);
return $exp;
}
?>
|
|
|||||||||||
|