Results 1 to 4 of 4

Thread: problem in my code php

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    2

    Unhappy problem in my code php

    in my code

    simple code (I beginner)

    -------------- test.php -----------

    <?
    echo $code;
    ?>

    -------------- test.php -----------

    OK

    if write in browser

    http://127.0.0.1/test.php?code=sorry I know not good speak English

    this will return:


    sorry I know not good speak English


    but the problem if write " or ' look :

    http://127.0.0.1/test.php?code=hi guy I'm swaa

    or

    http://127.0.0.1/test.php?code=I%27m swaa

    %27 = '
    this will return:


    I\'m swaa


    OoOh MY GOD what is this
    note : php add \

    how to write in browser without add \


    any help

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Is the code being submitted by an HTML form? If so, just change it from GET to POST. Ie, in your <form> tag, make sure you have method="post".
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    oh, wait! I understand what you mean now. Change your code to this:

    Code:
    <?php
        echo stripslashes($code);
    ?>
    The stripslashes() function does just that: strips the slashes.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    2
    Oh yeh, so he does


    Thanks for responding The Hobo,,

Posting Permissions

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



Click Here to Expand Forum to Full Width