Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Backslashes?

  1. #1
    Regular Coder the-dream's Avatar
    Join Date
    Mar 2007
    Location
    Northamptonshire, UK
    Posts
    477
    Thanks
    8
    Thanked 4 Times in 4 Posts

    Backslashes?

    hi,

    i have this code...

    PHP Code:
    <?php


        chmod
    ("index.html"0777) or die('Could Make File Writeable!');
        
    $html $_POST['profile'];
        
    $File "index.html";
        
    $Handle fopen($File'w') or die('Could not open file!');
        
    fwrite($Handle$html) or die('Could Not Write!');
        
    fclose($Handle) or die('Could Not Save');
        
        echo 
    "Profile Saved";
        
        
    ?>
    ... and i want is to strip the backslashes using stripslashes();

    However i have no idea how this is done. I have tried a nuber of time with a number of different ways but it still writes the html file with backslashes???

    Any Suggestions?

    Thanks,
    ~ Christian ( the-dream )

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    PHP Code:
    $html stripslashes($_POST['profile']); 
    or
    PHP Code:
    fwrite($Handlestripslashes($html)) or die('Could Not Write!'); 

  • #3
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    PHP Code:
    $html stripslashes($_POST['profile']); 
    Edit: Beaten to it

  • #4
    Regular Coder the-dream's Avatar
    Join Date
    Mar 2007
    Location
    Northamptonshire, UK
    Posts
    477
    Thanks
    8
    Thanked 4 Times in 4 Posts
    thanks!


  •  

    Posting Permissions

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