www.webdeveloper.com
Results 1 to 4 of 4

Thread: distored single quote mark

  1. #1
    Join Date
    Aug 2010
    Posts
    2

    distored single quote mark

    I have text area in one page and collect the text in the next page.
    If I type words with single quote mark, then it get distorted in next page.

    example, if I type
    thi's is a tes't

    I get this when submitted,
    thi\'s is a tes\'t

    (quotation mark altered to \')

    Why is this?
    here is my pages

    testx.php

    <html>
    <form method=post action='testy.php'>
    <textarea cols="40" rows="5" name="addwords">
    Now we are insid'e the area - which is nice.
    </textarea>
    <input type="submit" value="Submit" />
    </form>
    </html>



    testy.php

    <html>
    <?php
    $addwords = $_POST["addwords"];
    echo $addwords;
    ?>
    </html>

  2. #2
    Join Date
    Sep 2004
    Location
    Sri Lanka
    Posts
    473
    it seems to be u have given an incomplete sample code, instead orginal code..

    anyway instead

    Code:
    <html>
    <?php
    $addwords = $_POST["addwords"];
    echo $addwords;
    ?>
    </html>
    try following

    Code:
    <html>
    <?php
    $addwords = stripslashes($_POST["addwords"]);
    echo $addwords;
    ?>
    </html>

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,634
    You likely have the dreaded magic_quotes_gpc enabled on your host. Here's a little function I wrote to undo the damage: http://www.charles-reace.com/blog/20...-magic-quotes/
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Aug 2010
    Posts
    2
    Thanks, I will apply this and let you know the result. I am not php pro, need some time to apply function etc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles