guestbook.php
Código PHP:
<!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" />
<title>Untitled Document</title>
<link href="styles/crystal.css" rel="stylesheet" type="text/css" />
</head>
<?php
include('languajes/english/register.php');
include('languajes/english/guestbook.php');
include('includes/bbcode.php');
$dbhost='localhost';
$dbusername='root';
$dbuserpass='sein84244323';
$dbname='beast';
$con=mysql_connect($dbhost,$dbusername,$dbuserpass);
mysql_select_db($dbname,$con);
$pegar = "SELECT * FROM guestbook ORDER BY id DESC";
$cad = mysql_db_query($dbname,$pegar) or die (mysql_error());
$cad = do_bbcode($cad);
?>
<body class="body">
<div class="div_container">
<div class="div_title">Guestbook</div>
<div class="div_text">
<?php
while($array = mysql_fetch_array ($cad)) {
echo "<div class='div_gestbook'><strong>".$lang_guestbook['Username'].":</strong> <a class='a' target='_blank' href=".$array['website'].">".$array['username']."</a>
<br><strong>".$lang_guestbook['E-mail'].":</strong> ".$array['email']."
<br><strong>".$lang_guestbook['Time'].":</strong> ".$array['time']."
<br><br><strong>".$lang_guestbook['Message'].":</strong><br>".$array['message']."</div>
<hr class='hr'";
}
mysql_close($con);
?>
</div>
</div>
</body>
</html>
Código PHP:
<!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" />
<title>Untitled Document</title>
<link href="styles/crystal.css" rel="stylesheet" type="text/css" />
</head>
<?php
include('languajes/english/register.php');
$dbhost='localhost';
$dbusername='root';
$dbuserpass='sein84244323';
$dbname='beast';
$con=mysql_connect($dbhost,$dbusername,$dbuserpass);
mysql_select_db($dbname,$con);
$pegar = "SELECT * FROM guestbook ORDER BY id DESC";
$cad = mysql_db_query($dbname,$pegar) or die (mysql_error());
if(isset($_POST['submit'])){
$time=date("d/m/Y h:i A");
$sql = "INSERT INTO guestbook (username, email, website, message, time) VALUES ('".$_POST['username']."', '".$_POST['email']."', '".$_POST['website']."', '".$_POST['message']."', '$time')";
$result = mysql_query($sql);
exit;
}
?>
<body class="body">
<div class="div_container">
<div class="div_title">Guestbook</div>
<form method="POST" action="<? echo $_SERVER['PHP_SELF']; ?>">
<div class="div_text">
<?php echo $lang_register['Username'] ?>:<br />
<input type="text" name="username" id="username" size="25" maxlength="25" />
<br />
<?php echo $lang_register['E-mail'] ?>:<br />
<input type="text" name="email" size="35" maxlength="35" />
<br />
<div class="code">
<?php echo $lang_register['Website_Leyend'] ?>
</div>
<?php echo $lang_register['Website'] ?>:<br />
<input type="text" name="website" size="50" maxlength="50" />
<br />
<?php echo $lang_register['Website'] ?>:<br />
<textarea name="message" cols="30" rows=""></textarea>
</div>
<div class="div_text">
<input type="submit" value="<?php echo $lang_register['Submit'] ?>" name="submit">
</div>
</form>
</div>
</body>
</html>
Intente padar el aray $cad atravez de la funcion poniendo $cad=do_bbcode($cad); antes de leer $cad a travez del while.
Me pueden ayudar?