Loading ...
Sorry, an error occurred while loading the content.
 

PHP form not rendering speech marks/apostrophes properly

Expand Messages
  • PeteMatthewRichardDan
    I have just created a PHP form to publish messages on http://thefreedomofspeech.co.uk/ It s my first attempt and I m happy with it except that it s not
    Message 1 of 4 , Jan 2, 2013
      I have just created a PHP form to publish messages on http://thefreedomofspeech.co.uk/ It's my first attempt and I'm happy with it except that it's not rendering the apostrophe properly. It has a "/" before it. I contacted my ISP regarding the SQL set up and they said it's OK. I can't find anything else about it. Anyone got any ideas.
    • francismukobi
      ... I just want to get this clear. Is it like this / or is it like this / ? secondly, is the error displaying on. the web page? Francis Mukobi
      Message 2 of 4 , Jan 2, 2013
        --- In phpexperts@yahoogroups.com, "PeteMatthewRichardDan" <thehigharts@...> wrote:
        >
        > I have just created a PHP form to publish messages on http://thefreedomofspeech.co.uk/ It's my first attempt and I'm happy with it except that it's not rendering the apostrophe properly. It has a "/" before it. I contacted my ISP regarding the SQL set up and they said it's OK. I can't find anything else about it. Anyone got any ideas.
        >
        I just want to get this clear. Is it like this "/" or is it like this / ? secondly, is the error displaying on. the web page?

        Francis Mukobi
        http://frankhost.net
        Purchase a domain from us and we shall host your site for 3 months. FREE!
      • Mynul Islam
        Simply use addslashes() on variables before you store the data in database and stripslashes() before you display on screen! you are done! On Wed, Jan 2, 2013
        Message 3 of 4 , Jan 2, 2013
          Simply use addslashes() on variables before you store the data in database and stripslashes() before you display on screen!

          you are done!

          On Wed, Jan 2, 2013 at 3:54 PM, PeteMatthewRichardDan <thehigharts@...> wrote:
           

          I have just created a PHP form to publish messages on http://thefreedomofspeech.co.uk/ It's my first attempt and I'm happy with it except that it's not rendering the apostrophe properly. It has a "/" before it. I contacted my ISP regarding the SQL set up and they said it's OK. I can't find anything else about it. Anyone got any ideas.




          --
          With Thanks
          Mynul Islam
          +88-01715576388
        • PeteMatthewRichardDan
          Thanks so much for the advise. can you let me know where abouts I put the ode you suggest. As the PHP file I have ;
          Message 4 of 4 , Jan 3, 2013
            Thanks so much for the advise. can you let me know where abouts I put the ode you suggest.

            As the PHP file I have ;

            <?
            $cmt = $_POST['cmt'];
            $name = $_POST['name'];

            $file = "comments.htm";
            $content = file_get_contents($file);stripslashes();


            $fh = fopen($file, w) or die();
            fwrite($fh, $content . '<div style="margin-top:10px;text-align:left; border-top:1px solid #630;font-size:13px;">' . $name . '</div>' . '<div style="text-align:left;padding-left:10px;text-align:justify;font-size:11px;">' . $cmt . '</div><div style="height:10px; margin-bottom:10px;padding-left:10px;"> </div>');

            fclose($fh);

            echo '<meta http-equiv="refresh" content="0;url=http://thefreedomofspeech.co.uk/">';
            ?>

            Thanks.
          Your message has been successfully submitted and would be delivered to recipients shortly.