Lid |
|
Voor het toevoegen van nieuwsitems gebruik ik de volgende code:
<!-- saved from url=(0014)about:internet --><head>
<script src="../js/datetimepicker.js" type="text/javascript"></script>
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<?php
include ("../config/config.php");
include ("../fckeditor/fckeditor.php");
?>
<div class="blok2">Toevoegen nieuws</div>
<div id="main_border">
<form method="post" name="form" action="<?php echo $PHP_SELF ?>">
<table width="100%" border="0">
<tr>
<td width="12%" class="menutitle">Datum invoer:</td>
<td width="88%"><input name="datum_invoer" id="datum_invoer" type="text" size="20"><a href="javascript:NewCal('datum_invoer','ddmmyyyy')"><img src="../images/cal.gif" width="16" height="16" border="0"></a></td>
</tr>
<tr>
<td class="menutitle">Titel:</td>
<td><input name="titel" type="text" style="width:500px" /></td>
</tr>
<tr>
<td valign="top" class="menutitle">Bericht:</td>
<td><?php
$sBasePath = "../fckeditor/";
$oFCKeditor = new FCKeditor('nieuws');
$oFCKeditor->Height = 400;
$oFCKeditor->BasePath = $sBasePath;
$oFCKeditor->Value = '';
$oFCKeditor->Create();
?>
</td>
</tr>
<tr>
<td></td><td valign="top"><input type="Submit" value="Toevoegen"></td>
</tr>
</table>
</form>
<?php
mysql_select_db($database, $hvhazewind);
if($_SERVER['REQUEST_METHOD'] == "POST") {
$date = $_POST['datum_invoer'];
$titel = $_POST['titel'];
$bericht = $_POST['nieuws'];
$datum = date('Y-m-d', strtotime($date));
$query = mysql_query("INSERT INTO nieuws (titel, datum_invoer, nieuws) VALUES ('".$titel."', '".$datum."', '".$bericht."')") or die(mysql_error());
}
?>
</div>
<!-- saved from url=(0014)about:internet --><head> <script src="../js/datetimepicker.js" type="text/javascript"></script> <link href="main.css" rel="stylesheet" type="text/css" /> </head> <?php include ("../config/config.php"); include ("../fckeditor/fckeditor.php"); ?> <div class="blok2">Toevoegen nieuws</div> <div id="main_border"> <form method="post" name="form" action=" <?php echo $PHP_SELF ?>"> <table width="100%" border="0"> <tr> <td width="12%" class="menutitle">Datum invoer:</td> <td width="88%"><input name="datum_invoer" id="datum_invoer" type="text" size="20"><a href="javascript:NewCal('datum_invoer','ddmmyyyy')"><img src="../images/cal.gif" width="16" height="16" border="0"></a></td> </tr> <tr> <td class="menutitle">Titel:</td> <td><input name="titel" type="text" style="width:500px" /></td> </tr> <tr> <td valign="top" class="menutitle">Bericht:</td> <td><?php $sBasePath = "../fckeditor/"; $oFCKeditor = new FCKeditor('nieuws'); $oFCKeditor->Height = 400; $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->Value = ''; $oFCKeditor->Create(); ?> </td> </tr> <tr> <td></td><td valign="top"><input type="Submit" value="Toevoegen"></td> </tr> </table> </form> <?php if($_SERVER['REQUEST_METHOD'] == "POST") { $date = $_POST['datum_invoer']; $titel = $_POST['titel']; $bericht = $_POST['nieuws']; $query = mysql_query("INSERT INTO nieuws (titel, datum_invoer, nieuws) VALUES ('".$titel."', '".$datum."', '".$bericht."')") or die(mysql_error()); } ?> </div>
De letters é e.d worden wel goed weergegeven.
Ik kan alleen het teken ' niet gebruiken in de tekst. Dit word dan niet opgelagen in de databse.
Wie weet hoe ik dit kan oplossen?
|