whelpton Posted February 1, 2009 Share Posted February 1, 2009 Okay, im saving data into text files using php. Whenever I do it seems to add characters randomly. For instance: I\'m making an edit here. This is\'s just a test The slashes before the apohstrophe's are added by php. Is there any way round this? Link to comment https://forums.phpfreaks.com/topic/143320-one-last-question-php-text-files/ Share on other sites More sharing options...
Prismatic Posted February 1, 2009 Share Posted February 1, 2009 stripslashes() Link to comment https://forums.phpfreaks.com/topic/143320-one-last-question-php-text-files/#findComment-751686 Share on other sites More sharing options...
whelpton Posted February 1, 2009 Author Share Posted February 1, 2009 I suppose I should have expanded a bit more, thanks for your advice on strip slashes, but how would I impliment it into this code? <?php $f = fopen("/home/alport/public_html/".$_SESSION['s_username']."/text/profile.txt", 'w'); fwrite($f, $_POST['save']); fclose($f); header('Location: home.php?action=change'); ?> or is it something that needs to be added at the form stage? Link to comment https://forums.phpfreaks.com/topic/143320-one-last-question-php-text-files/#findComment-751691 Share on other sites More sharing options...
taith Posted February 1, 2009 Share Posted February 1, 2009 <?php $f = fopen("/home/alport/public_html/".$_SESSION['s_username']."/text/profile.txt", 'w'); fwrite($f, stripslashes($_POST['save'])); fclose($f); header('Location: home.php?action=change'); ?> Link to comment https://forums.phpfreaks.com/topic/143320-one-last-question-php-text-files/#findComment-751695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.