PHP:
$var = "Sum Random'z String"s with quotemarks"
$send = base64_encode($var)
Then it sends the base64 encoded string to server.
Server part (Python) tryes to decode the base64-encoded content and write it into file:
f = open("/root/data.yml","w")
f.write(base64.b64decode(sys.argv[1]))
f.close()
sys.argv[1] is $send
However, when i open data.yml in nano or cat, i get this:
Sum Random\'z String\"s with quotemarks
I dont want \ there.
Is there a way so the \ character will not appear there, when i open it in nano or cat? What shall i change?
EDIT:
$var is taken from textarea where there are no \
You don’t need to escape both the single and double quote. You only need to escape what you’re quoting the string with (i.e.
")This may not be your only problem. But it is part of the problem.
UPDATE
Per your update of
$varbeing set with data from a form textarea, you need to look at stripslashes()