简体   繁体   English

在HEADER('Location:')命令中如何使用URLENCODE?

[英]How URLENCODE be used within HEADER('Location:') command?

i have a php code i want header command work with URLENCODE 我有一个PHP代码,我希望标头命令与URLENCODE一起工作

header("location:invoice.php?userID=".$userID."&invoiceID=".$invoiceID);

the url show like this below and i want when username call from database if in username any special character like "&" with help of URLENCODE in url & into %26 so URL work perfectly. URL显示如下,我想当用户名从数据库中调用时,如果用户名中有任何特殊字符(如“&”),并在URL&的URLENCODE的帮助下进入%26,因此URL可以正常工作。

https://domainname.com/invoice.php?userID=Aayaan&Arbab&invoiceID=13314
header("location: invoice.php?userID=". urlencode($userID)."&invoiceID=".$invoiceID);

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

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