ah si scusate.
nn mi ha incollato bene il testo che avevo scritto da altra parte.
Codice PHP:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Insert</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<script type="text/javascript" src="../ckeditor.js"></script>
<script src="sample.js" type="text/javascript"></script>
<link href="sample.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
if (isset($_POST['inserisci'])) {
include '../../config.php';
$link = mysql_connect($host, $user, $password) or die("Non è possibile connettersi al server
");
$conn = mysql_select_db($db, $link) or die("Non è possibile connettersi al db
");
$title = $_POST['title'];
$sectionid = $_POST['sectionid'];
$testo = $_POST['fulltext'];
$insert = "INSERT INTO articoli (title, sectionid, `fulltext`) VALUES ('$title', '$sectionid', '$testo')";
if ($_POST['title'] == NULL || $_POST['sectionid'] == NULL || $_POST['fulltext'] == NULL) {
echo "dati mancanti";
} else {
mysql_query($insert) or die(mysql_error($link));
}
}
?>
<h1>
CKEditor Sample
</h1>
<div id="alerts">
<noscript>
[b]CKEditor requires JavaScript to run[/b]. In a browser with no JavaScript
support, like yours, you should still see the contents (HTML data) and you should
be able to edit it normally, without a rich editor interface.
</p>
</noscript>
</div>
<div>
<h3>Menu</h3>
[url="../../index.php"]Home[/url]
</div>
<form action="#" method="post" name="inserisci">
Title: <input type="text" name="title" />
</p>
<select name="sectionid">
<option value="13">Linux</option>
<option value="14">Mac</option>
</select>
</p>
<textarea class="ckeditor" cols="80" id="editor1" name="fulltext" rows="10"></textarea>
</p>
<input type="submit" name="inserisci" value="Submit" />
</p>
</form>
</body>
</html>
in pratica nn mi da errori però nn mi iserisce i dati.
volevo sapere se è giusto oppure come fare a usare un <select> per inserire dati in mysql.