golles
I use a PHP script to load ans save (edit) a txt file.
but I have an error in my save code, it changes adds \ to the textarea
example:
I hope someone can help me with my code:
it saves the text in an text area, I think it is usefull to have to code of the other page so here it is:
the first code is linkSave.php but I think you allready knew that
I think the error is in this line:
thanks in advance!
//golles
[edit]afther a good read I noticed they come in fron to a ', what to do?[edit]
but I have an error in my save code, it changes adds \ to the textarea
example:
| Quote: |
| <a href=\'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/vb6anchor.asp\' target=\'_blank\'>MSDN</a>, gepost door <a href=\'mailto:golles@gmail.com\'>golles</a> |
I hope someone can help me with my code:
| Code: |
|
<?php include 'login.php' ?> <?php $fn = "link.txt"; $content = stripslashes($_POST['links']); $fp = fopen($fn,"w+") or die ("Fout met het openen van het bestand!"); fputs($fp,$links); fclose($fp) or die ("Fout met het sluiten van het bestand!"); ?> <br><br><br><br> <center>De pagina is met succes opgeslagen<br><br> |
it saves the text in an text area, I think it is usefull to have to code of the other page so here it is:
| Code: |
|
<?php include 'login.php' ?> <html> <head> <title>Admin pagina</title> </head> <body> <form method="POST" action="linksSave.php"> <textarea name="links" rows="30" cols="100"> <?php $fn = "link.txt"; print htmlspecialchars(implode("",file($fn))); ?></textarea><br> <input type="submit" value="Opslaan" name="Save"> </form> </body> </html> |
the first code is linkSave.php but I think you allready knew that
I think the error is in this line:
| Code: |
|
$content = stripslashes($_POST['links']); |
thanks in advance!
//golles
[edit]afther a good read I noticed they come in fron to a ', what to do?[edit]
