I built a CMS system using CKEditor and KCFinder that store information od a databse via textarea/php. So far so good!
The issue comes to when I want to store and display images that link to themselves. The way I am storing images is exactly the same: There is a textarea where I insert an image via KCFinder/CKEditor. The image is uploaded to the server and the path stored at the database. Later I try to pick up that path from the database to display the image (that part also works) and because I want the image to link to itself, I try to use the same method to insert the url on the link. Problem? The link is missing.
Can anyone point me the error and suggest any solution? I would be so thankful!
Code:
<?php
$sql = "SELECT * FROM php_maskiner ORDER BY timestamp DESC";
$result = mysql_query($sql) or print ('<div class="alert alert-standard fade in">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>Can't read the database!</strong>
</div>' . $sql . "<br />" . mysql_error());
while($row = mysql_fetch_array($result)) {
$title = stripslashes($row['title']);
$entry = stripslashes($row['entry']);
$images = html_entity_decode($row['images']);
$img_url = $row['images'];
$img_pack = '<div class="mask3 span3">
<a rel="prettyPhoto" href="' . $img_url . '">' . $images . '</a>
</div>';
?>
<article class="span12 post">
<?php echo $img_pack; ?>
<div class="inside">
<div class="span8 entry-content">
<div class="span12">
<h2><?php echo $title; ?></h2>
<p><?php echo $entry; ?></p>
</div>
</div>
</div>
</article>
<?php
}
?>
UPDATE:
I think that this might be a problem caused by CKEditor. In the database the image path is store as: . This is in my understanding what is being outputted. How do I do to output only "/nysida/admin/kcfinder/upload/images/1307594_10243178.jpg"?