0
I wanted a more elegant way to write the code below. He is passing the parameters via GET but goes with ' and I can even use a PHP function of replace but wanted a solution without gambiarra. Note that it is ' inside ' then I put ' but it goes in the parameter and I put " php does not work. Follow the code
onClick=\"window.parent.document.getElementById('webcam_show').src='webcam_html5/index.php?text_area=\'ta_proprietario_altera_foto64\'&frame_destino=\'frame_proprietario_foto_altera\'';window.parent.div_mostra('webcam')\"
There’s nothing wrong with escaping a string
– MarceloBoni
Blza, I even agree that it wouldn’t be the end of the world, but I’m really bored with this project, I was wondering if there’s a way not to do this. thanks.
– Luis Miguel
Can you post more of your code, from the variable that receives the string you want to escape? The way it is, I confess that for me, it’s a little hard to understand
– MarceloBoni
but pq that ' on the line? If it is in php it is not necessary. The value of the variable does not need quotes. But if, however, you still want to put simple quotes replace ' with ". Chr(39)." Here’s how it looks: ..... index.php? text_area=". Chr(39)." ta_proprietario_altera_foto64". Chr(39)." &frame_destination ..... But the best thing is to answer Marceloboni’s request so that we can answer with certainty.
– user60252
the ' on the line appears as I cannot pass a text parameter via get without quotation marks. Thanks for the help, it seems a good solution.
– Luis Miguel