Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) /’ :'( Anoying problem

  • /’ :'( Anoying problem

    Posted by Dan Browne on May 1, 2008 at 12:33 am

    I have 2 sites going that I have just noticed a problem with. One has an email form where the user puts their email address, their name, and their comment, click submit and it sends the email to me. The other has a form where the user types in their text, clicks submit, that saves the text inputed into a text file, and somewhere else on the site, it pulls the text from that file and includes it in the site. The problem I am having is whenever someone uses a ‘ it saves/sends it like this /’ so if someone writes “it’s a lovely day”, it appears like “it/’s a lovely day”. How am I able to make it display as it should? Hope that’s clear.
    Cheers,
    Dan

    Dan Browne
    Hawkes Bay, New Zealand
    Cloud South Films
    http://www.cloudsouthfilms.co.nz

    Dan Browne replied 18 years ago 2 Members · 5 Replies
  • 5 Replies
  • Curtis Thompson

    May 1, 2008 at 1:07 am

    hello…

    w/o knowing your scripting language, it’s hard to be perfectly accurate, but this looks like php’s old magic quotes issue – try this function:

    https://us.php.net/stripslashes

    hope that helps!

    sitruc

  • Dan Browne

    May 1, 2008 at 1:14 am

    hey,
    Yeah sorry, I was scripting in php. Thanks for that, just about to look at it now.
    D

    Dan Browne
    Hawkes Bay, New Zealand
    Cloud South Films
    http://www.cloudsouthfilms.co.nz

  • Dan Browne

    May 1, 2008 at 3:10 am

    I couldnt work out from that page what to do to solve the problem. This is my code:
    /On the page with the form/

    Edit Text

    <textarea name=”contents” cols=”100″ rows=”10″ id=”contents”>
    </textarea>

    Back

    /and on the post.php page/




    Success

     

    Any help is greatly appreciated.
    Cheers,
    Dan

    Dan Browne
    Hawkes Bay, New Zealand
    Cloud South Films
    http://www.cloudsouthfilms.co.nz

  • Curtis Thompson

    May 1, 2008 at 3:49 am

    hello…

    didn’t see stripslashes in there, so not sure where you tried, but this line looks like a potential candidate:

    $contents=$_POST[‘contents’];

    so i’d make that:

    $contents=stripslashes($_POST[‘contents’]);

    basically get rid of them in any variable you want to before you save it to the file and you should be ok…

    sitruc

  • Dan Browne

    May 1, 2008 at 4:36 am

    awesome, works like a charm. Thank you 😀

    Dan Browne
    Hawkes Bay, New Zealand
    Cloud South Films
    http://www.cloudsouthfilms.co.nz

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy