Jump to content

jonybigude

New Members
  • Posts

    4
  • Joined

  • Last visited

jonybigude's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am starting to wonder if this is a problem caused by CKEditor... This is the code that CKEditor inserts on the database: <img alt="" src="/nysida/admin/kcfinder/upload/images/1307594_10243178.jpg" /> Anyway, the answer to your question is: NULL
  2. Yes, I am sure (unfortunately)... Here is the outputed HTML: <a src="/nysida/admin/kcfinder/upload/images/332805_3333.jpg" "="" href="<img alt=" rel="prettyPhoto"> "> <img "="" src="<img alt="></img> "> </a>
  3. 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 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 and the images are not displaying. Can anyone point me the error and suggest any solution? I would be so thankful! CODE: try { $DBH = new PDO('mysql:host=localhost;dbname=yourdb;charset=utf8', 'user', 'password'); $DBH->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $STH = $DBH->prepare('SELECT * FROM php_maskiner ORDER BY timestamp DESC'); $STH->execute(); $STH->setFetchMode(PDO::FETCH_OBJ); while($row = $STH->fetch()) { $title = $row->title; $entry = $row->entry; $images = $row->images; $img_url = $row->images; $img_pack = '<div class="mask3 span3"> <a rel="prettyPhoto" href="'.$img_url.'"><img src="'.$images.'"></a> </div>'; } $DBH = null; } catch (PDOException $e) { echo '<div class="alert alert-standard fade in"> <a class="close" data-dismiss="alert" href="#">×</a> <strong>Can\'t read the database!</strong> </div><br />'.$e; } <?php echo '<article class="span12 post"> '.$img_pack.' <div class="inside"> <div class="span8 entry-content"> <div class="span12"> <h2>'.$title.'</h2> <p>'.$entry.'</p> </div> </div> </div> </article>'; ?> Thanks in advance!
  4. Hi! I have been searching on the web for solutions but for some reason it seems that I can't implement them. I am a rookie in PHP and perhaps the mistake has been under my nose all this time but I did not manage to see it... Here goes my contact form: <form method="post" action="kontakt.php"> <label>Namn *</label> <input name="name" placeholder="Type Here"> <label>Telefon *</label> <input name="telef" placeholder="Type Here"> <label>E-post *</label> <input name="email" type="email" placeholder="Type Here"> <label>Meddelandet</label> <textarea name="message" placeholder="Type Here"></textarea> <label>*Hur mycket är 2+2? (Anti-spam)</label> <input name="human" placeholder="Type Here"> <input id="submit" name="submit" type="submit" value="Submit"> <?php $name = $_POST['name']; $telef = $_POST['telef']; $email = $_POST['email']; $message = $_POST['message']; $from = 'Lounge Terrasse'; $to = 'kontakt@lfsolutions.se'; $subject = 'Lounge Terrasse - Ny meddelande'; $human = $_POST['human']; $headers = "MIME-Version: 1.0" . PHP_EOL; $headers .= "From: $from <$email> ". PHP_EOL; $headers .= "Content-type: text/html;charset=UTF-8 ". PHP_EOL; $body = "From: $name\n Telefon: $telef\n E-Mail: $email\n Message:\n $message"; if ($_POST['submit']) { if ($name != '' && $email != '' && $telef != '') { if ($human == '4') { if (mail ($to, $subject, $body, $from)) { echo '<p>Your message has been sent!</p>'; } else { echo '<p>Something went wrong, go back and try again!</p>'; } } else if ($_POST['submit'] && $human != '4') { echo '<p>You answered the anti-spam question incorrectly!</p>'; } } else { echo '<p>You need to fill in all required fields!!</p>'; } } ?> </form> So... any suggestions in order to implement correctly the utf8, since the e-mails are still coming with weird characters? Thanks in advance!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.