php parameter with apostrophes

后端 未结 2 1461
不知归路
不知归路 2021-01-28 17:51

I have string parameter with apostrophes that I need to pass it to another php page. My code is:

echo \'
相关标签:
2条回答
  • 2021-01-28 18:26

    What's happening is that the URL parser is breaking on the single quotes. Check out the URLEncode method, to encode your query string parameters.

    http://us3.php.net/urlencode

    0 讨论(0)
  • 2021-01-28 18:45
    echo '<form name="submitForm2" action="creatDocument.php?$formulation='.urlencode(utf8_encode($formulation)).'" method="POST">
         <input type="submit" value="pass"/>
         </form>';
    
    0 讨论(0)
提交回复
热议问题