To jest wysyłanie danych do MySQL:
<?php
?>
<?php
include("db.php");
$tabela1 = 'wiadomosci';
$id = $_SESSION['id'];
if ($_POST) {
$imie = $dodatkowe['imie'];
$nazwisko = $dodatkowe['nazwisko'];
$id = $_SESSION['id'];
//sprawdzamy dane
$blad++;
echo '<span class="blad">Proszę podac link obrazka (do 100 znaków).</span>'; }
$blad++;
echo '<span class="blad">Proszę wprowadzić poprawny wstep (do 50 znaków).</span>'; }
$blad++;
echo '<span class="blad">Proszę wprowadzić poprawnie tytul (do 25 znaków).</span>'; }
if ($blad == 0) {
$wynik = mysql_query("INSERT INTO $tabela1 VALUES('', '$tytul', '$wstep', '$obrazek', '$id', '$imie', '$nazwisko', '$trescmax', NOW())"); if ($wynik)
{
echo '<h1><font color="green">Dodano artykół</font></h1>'; header( "refresh:1;url=../../artykuly.php" ); }
}
}
A to formularz:
<!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"> <title>Full Page Editing - CKEditor Sample
</title> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <script type="text/javascript" src="../ckeditor.js"></script> <link href="sample.css" rel="stylesheet" type="text/css" /> Dodaj artykuł
<!-- This <div> holds alert messages to be display in the sample page. -->
<form action="dodajw.php" method="post"> <input type="text" name="tytul" height="500" id="imie" />
<input type="text" name="wstep" height="500" id="imie" />
<input type="text" name="obrazek" height="500" id="imie" />
<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
});
//]]>
<input type="submit" value="Submit" /> CKEditor - The text editor for Internet -
<a href="http://ckeditor.com/">http://ckeditor.com
</a> Copyright
© 2003-2010,
<a href="http://cksource.com/">CKSource
</a> - Frederico
Knabben. All rights reserved.