Kod
<b>, <img>, <a> itp.
do bazy mysql. Jak dodaje tekst np: Kod
<b>test</b>
to pokazuje mi w bazie tylko siema bez znaczników HTML... Da się jakoś zapisać te znaczniki? 
<?php ?> <?php include("db.php"); $tabela1 = 'wiadomosci'; $id = $_SESSION['id']; $dodatkowe = mysql_fetch_assoc(mysql_query("SELECT imie, nazwisko FROM dodatkowe_dane WHERE `id_user`=". $id ." LIMIT 1;")); if ($_POST) { $imie = $dodatkowe['imie']; $nazwisko = $dodatkowe['nazwisko']; $id = $_SESSION['id']; //sprawdzamy dane $blad++; } $blad++; } $blad++; } if ($blad == 0) { $wynik = mysql_query("INSERT INTO $tabela1 VALUES('', '$tytul', '$wstep', '$obrazek', '$id', '$imie', '$nazwisko', '$trescmax', NOW())"); if ($wynik) { } } }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or <a href="http://ckeditor.com/license" target="_blank">http://ckeditor.com/license</a> --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <link href="sample.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> Dodaj artykuł </h1> <!-- This <div> holds alert messages to be display in the sample page. --> <div id="alerts"> <noscript> <p> </p> </noscript> </div> <form action="dodajw.php" method="post"> <p> <label for="editor1"> <input type="text" name="tytul" height="500" id="imie" /> </p> <p> <label for="editor1"> <input type="text" name="wstep" height="500" id="imie" /> </p> <p> <label for="editor1"> <input type="text" name="obrazek" height="500" id="imie" /> </p> <p> <label for="editor1"> <textarea cols="80" id="editor1" name="editor1" rows="10"><html><head><title>CKEditor Sample</title></head><body><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></body></html></textarea> <script type="text/javascript"> //<![CDATA[ CKEDITOR.replace( 'editor1', { fullPage : true }); //]]> </script> </p> <p> <input type="submit" value="Submit" /> </p> </form> <div id="footer"> <hr /> <p> </p> <p id="copy"> Knabben. All rights reserved. </p> </div> </body> </html>
<?php ?> <?php include("db.php"); $tabela1 = 'wiadomosci'; $id = $_SESSION['id']; $dodatkowe = mysql_fetch_assoc(mysql_query("SELECT imie, nazwisko FROM dodatkowe_dane WHERE `id_user`=". $id ." LIMIT 1;")); if ($_POST) { $imie = $dodatkowe['imie']; $nazwisko = $dodatkowe['nazwisko']; $id = $_SESSION['id']; //sprawdzamy dane $blad++; } $blad++; } $blad++; } if ($blad == 0) { $wynik = mysql_query("INSERT INTO $tabela1 VALUES('', '$tytul', '$wstep', '$obrazek', '$id', '$imie', '$nazwisko', '$html', NOW())"); if ($wynik) { } } }