使用urlencode重定向问题
我试图通过 URL 传递值,但当我检索它时,它看起来像这样“,urlencode(15.99)”,
该值是正确的,但我尝试了不同的方法,但仍然无法在没有 urlencode 或添加语法的情况下发送值 我尝试发送值的代码行是
redirect_to("$the_file_is?subj=' . urlencode($the_price_is)' ");
Am trying to pass the value hrough the URL but when i retrieve it it appears like this ' , urlencode(15.99),'
the value is correct but i have tried different things but still unable to just send the value without the urlencode or added syntax
the line of code am trying to send the value is
redirect_to("$the_file_is?subj=' . urlencode($the_price_is)' ");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
假设我理解正确,这应该可以满足您的要求:
redirect_to($the_file_is . '?subj=' . urlencode($the_price_is));
This should do what you're looking for, assuming I understood it correctly:
redirect_to($the_file_is . '?subj=' . urlencode($the_price_is));
当然只是更改为...
Surely just change to...
几乎就这样了 - 只是有点报价混乱:)
redirect_to("$the_file_is?subj=" .urlencode($the_price_is));
值得注意的是,您可以在双引号中引用变量,因此:
< code>echo "hello $name"; 可以,但
echo "$actioned";
可能需要echo "{$action}ed"; echo $action.'ed';
取决于。Almost there - just a little bit of quote confusion :)
redirect_to("$the_file_is?subj=" . urlencode($the_price_is));
It's worth noting that you can reference variables in double quotes so:
echo "hello $name";
will work, butecho "$actioned";
might need to beecho "{$action}ed"; echo $action.'ed';
depending.