Since the last time Blanius helped me so much with a script i have another question. I like to have the possibility to edit links to other site's just like the rest of the text on the site. So when i am writing text in the edit box and past in a link like <a href="http://3dfa.com">3dfa</a> and then save the link it changes to <a href=\"http://3dfa.com\">3dfa</a> (see the zip file)
It seems to have a problem with the quotes.
Somebody out there who can give me a helping hand.
I just tried using <a href="http://3dfa.com">3dfa</a> in an editbox that has HTML set to on and it works fine. Only issue is that it doesn't underline it as you would expect but you could just add <u> </u> if you want to that's what my guest book does
Blanius,
The link works when i put it in a HTML box. But with the php script writing the input from the HTML box to a links.txt file on the server it fails.
You can see what i mean at www.rmvos.nl/writetoserver.html
There you see exactly what i mean when you write down a link.
this is the php part. You made it yourself didn't you?
But where do i have to strip the /
<?php
if ($_POST['cmd']=='w'){
//to write a file
$fp=fopen ($_POST[file],'w');//open file for writing
fwrite($fp,"&var1=".$var1);//save what ever is in the string contents
fclose ($fp);//close it
}else{
//open a file and assign it a 'handle' of fp
$fp=fopen($file_name,'r') ;
//Then read the file
$contents = fread ($fp, filesize ($file_name));
fclose ($fp);//done close the file
}
//either way I think it's ok to send the contents back to 3dfa
//so send it
echo "&var1=".$var1;//change this to the variable you use in 3dfa
?>
hmm where is it adding the slashes? Must be in the 3dfa code. Try removing where it adds them in the first place. I don't think you need them here anyway. If you where using the html strings in PHP you would but shouldn't just to save to server. Otherwise I'll try to whip up code to remove the slash.
Simple solution might be to just strip the slashes in the PHP before sending it to 3dfa. I probably add the slashes when saving the file it is needed.
change the following line
echo "&var1=".stripslashes($var1);
I tried changing the line like you sayed but that didn't do the job. ;-(
Is there a way to strip the slashes when reading the txt file.
Do you know something else ?