简体   繁体   English

我正在尝试通过网址将包含空格的变量传递到php页面

[英]I am trying to pass variables which contain spaces through to a php page via a url

The strings are not being passed via the url to the php page if they contain spaces. 如果字符串包含空格,则不会通过URL传递到php页面。 is it possible to pass strings with spaces through the url? 是否可以通过网址传递带空格的字符串?

url code 网址代码

$message = $email_message.'<a href="http://www.example.co.uk/email_feedback/feedback_result.php?name='.$name.'&email_message='.$email_message.'">Click HERE to Activate</a>';

Yes, replace spaces in the URL with + . 是的,用+替换URL中的空格。 So ?name=John Doe becomes ?name=John+Doe . 因此, ?name=John Doe变为?name=John+Doe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM