Writing URLs to a file (problem with \")

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tihon

    Writing URLs to a file (problem with \")

    Hello,
    I got a problem with writing to a text file, everytime i try to write
    a url to file it gets replaced, for example i post:
    <a href="http://www.google.com" >google.com</a>
    and i get:
    <a href=\"http://www.google.com\ ">google.co m</a>
    Is there anyway to write " " " to a file without it being replaced by " \" "?
    ====
    winxp
    ====
    $post = $_REQUEST["post"];
    $fp = fopen("myfile.t xt", "w" );
    fwrite( $fp, $post,strlen($p ost));
    fclose( $fp );
    ====
    Thank you very much!
  • Garp

    #2
    Re: Writing URLs to a file (problem with \&quot;)


    "Tihon" <tihon@ziplip.c om> wrote in message
    news:7da634b3.0 404111632.6a9a2 358@posting.goo gle.com...[color=blue]
    > Hello,
    > I got a problem with writing to a text file, everytime i try to write
    > a url to file it gets replaced, for example i post:
    > <a href="http://www.google.com" >google.com</a>
    > and i get:
    > <a href=\"http://www.google.com\ ">google.co m</a>
    > Is there anyway to write " " " to a file without it being replaced by " \"[/color]
    "?[color=blue]
    > ====
    > winxp
    > ====
    > $post = $_REQUEST["post"];
    > $fp = fopen("myfile.t xt", "w" );
    > fwrite( $fp, $post,strlen($p ost));
    > fclose( $fp );
    > ====
    > Thank you very much![/color]

    Run it through stripslashes() first?

    Garp


    Comment

    • Adrian Stutz [anime_layer]

      #3
      Re: Writing URLs to a file (problem with \&quot;)

      Check the magic_quotes_gp c and magic_quotes_ru ntime sections in this manual
      page:
      PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.

      You can disable magic_quotes_ru ntime at runtime but you have to disable
      magic_quotes_gp c using php.ini or .htaccess files if you're allowed to. You
      can check if magic_quotes_gp c is activated using get_magic_quote s_gpc() and
      act accordingly.
      It's propably more portable stripslashes() than having to disable this each
      time.

      Ja ne
      Adrian

      tihon@ziplip.co m (Tihon) wrote:
      (snip)[color=blue]
      >Is there anyway to write " " " to a file without it being replaced by " \" "?[/color]

      (snip)

      --
      Sou desu-ka? O_o -_- x_x _
      http://www.animelayer.net/ (Reviewdatenban k)

      Comment

      • Tihon

        #4
        Re: Writing URLs to a file (problem with \&quot;)

        "Garp" <garp7@no7.blue yonder.co.uk> wrote in message news:<2Nmec.155 9$ob5.15085759@ news-text.cableinet. net>...[color=blue]
        > "Tihon" <tihon@ziplip.c om> wrote in message
        > news:7da634b3.0 404111632.6a9a2 358@posting.goo gle.com...[color=green]
        > > Hello,
        > > I got a problem with writing to a text file, everytime i try to write
        > > a url to file it gets replaced, for example i post:
        > > <a href="http://www.google.com" >google.com</a>
        > > and i get:
        > > <a href=\"http://www.google.com\ ">google.co m</a>
        > > Is there anyway to write " " " to a file without it being replaced by " \"[/color]
        > "?[color=green]
        > > ====
        > > winxp
        > > ====
        > > $post = $_REQUEST["post"];
        > > $fp = fopen("myfile.t xt", "w" );
        > > fwrite( $fp, $post,strlen($p ost));
        > > fclose( $fp );
        > > ====
        > > Thank you very much![/color]
        >
        > Run it through stripslashes() first?
        >
        > Garp[/color]

        Thank you so much! That was exactly what was needed!
        Thank you again!

        Comment

        Working...