Hey Guys...
What is happening. Im posting text into a database threw a WYSIWYG editor but then when I print it it comes out of the database it is in html.
Here is an example (its in the bio):
http://www.wowevocation.com/profile.php?id=1
Code:
<?php
session_start();
// Connect to database
include_once "scripts/connect_to_mysql.php";
// Now let's initialize vars to be printed to page in the HTML section so our script does not return errors
// they must be initialized in some server environments
$id = "";
$firstname = "";
$middlename = "";
$lastname = "";
$country = "";
$state = "";
$city = "";
$zip = "";
$bio_body = "";
$bio_body = "";
$website = "";
$youtube = "";
$user_pic = "";
$gamertag = "";
$blabberDisplayList = "";
$username = "";
// If coming from category page
if ($_GET['id']) {
$id = $_GET['id'];
} else if (isset($_SESSION['id'])) {
$id = $_SESSION['id'];
} else {
include_once "/index.php";
exit();
}
$id = mysqli_real_escape_string($myConnection,$id);
$id = eregi_replace("`", "", $id);
$sql = mysqli_query($myConnection,"SELECT * FROM members WHERE id='$id'");
while($row = mysqli_fetch_array($sql)){
$username = $row["username"];
$country = $row["country"];
$state = $row["state"];
$city = $row["city"];
$gamertag = $row["gamertag"];
$sign_up_date = $row["signupdate"];
$sign_up_date = strftime("%b %d, %Y", strtotime($sign_up_date));
$last_log_date = $row["lastlogged"];
$last_log_date = strftime("%b %d, %Y", strtotime($last_log_date));
$bio_body = $row["bio_body"]; [B][U][SIZE="3"][COLOR="Red"]<----BIO [/COLOR][/SIZE][/U][/B]
$website = $row["website"];
$youtube = $row["youtube"];
/////// Mechanism to Display Pic. See if they have uploaded a pic or not //////////////////////////
$check_pic = "members/$id/image01.jpg";
$default_pic = "members/0/image01.jpg";
if (file_exists($check_pic)) {
$user_pic = "<img src=\"$check_pic\" width=\"300px\" />"; // forces picture to be 100px wide and no more
} else {
$user_pic = "<img src=\"$default_pic\" width=\"300px\" height=\"300px\" />"; // forces default picture to be 100px wide and no more
}
/////// Mechanism to Display Youtube Channel and Gamertag or not //////////////////////////
if ($youtube == "") {
$youtubeChannel = "";
} else {
$youtubeChannel = ' <script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/youtube.xml&up_channel=' . $youtube . '&synd=open&w=290&h=370&title=&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script> '; // forces default picture to be 100px wide and no more
if ($gamertag == "") {
$gamertag = "";
} else {
$gamertag = ' <iframe src="http://gamercard.xbox.com/' . $gamertag . '.card" scrolling="no" frameBorder="0" height="140" width="204">' . $gamertag . '</iframe> ';
}
if ($website == "") {
$website = "";
} else {
$website = ' <a href=" . $website . ">' . $website . '</a> ';
}
// close while loop
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$style_sheet = "default";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Description" content="Profile for <?php print "$username"; ?>" />
<meta name="Keywords" content="<?php print "$username, $state, $country"; ?>" />
<meta name="rating" content="General" />
<meta name="ROBOTS" content="All" />
<title> <?php print "$username"; ?>'s profile at WowEvocation</title>
<link href="style_profiles/<?php print "$style_sheet"; ?>.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="/faivcon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/faivcon.ico" type="image/x-icon" />
<link href="style_profiles/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper"><img src="images/logoh75.png" width="900" height="75" alt="banner" />
<div id='leftad'><?php include_once "leftad.php"; ?></div>
<div id='leftbody'><p><h1></b></h1>
<table width="600" border="0">
<tr>
<td width="304"><?php print "$username" ?></td>
<td width="286"><p><b>Bio:</b></p>
<?php echo "$bio_body" ?>[COLOR="red"][U][SIZE="4"][B]//BIO ECHO!!![/B][/SIZE][/U][/COLOR]</td>
</tr>
<tr>
<td><div id='borderpx5'><?php print "$user_pic" ?></div></td>
<td><?php print "$username" ?>'s Website<br /><?php print "$website" ?></td>
</tr>
<tr>
<td><b>Date Joined:</b><?php print "$sign_up_date" ?><br />
<b>Last Logged In:</b><?php print "$last_log_date"?></td>
<td><p><a href="http://www.youtube.com/<?php print "$youtube" ?>"><img src="images/ytubebutton.png" alt="<? print "$username" ?>'s YouTube Channel" width="80" height="80" border="0" /></a></p>
<p><?php print "$gamertag" ?></p></td>
</tr>
</table>
<br /><br />
<br />
<br />
<br />
<br />
<br />
</div>
<br />
<div id='footer'><?php include_once "footer.php"; ?></p></div>
</div>
</body>
</html>