我使用$ _GET从URL获取值,变量是带有
等数据的消息 message=<b>Volatino+riepilogo+ordine%3A<%2Fb>+<br%2F>+<br%2F>Layout+selezionato%3A+<b>2<%2Fb><br%2F>Slogan+%3A+asd<br%2F>Testo+descrittivo+offerta+%3A+asdasd<br%2F>Indirizzo+%3A+asd<br%2F>Telefono+%3A+asdsd<br%2F>Email+%3A+asd<br%2F>Sito+web+%3A+asd<br%2F>Colore+primario%3A+%23e6a1a1<br%2F>Colore+secondario%3A+%23b36868<br%2F>1-+Prodotto+asd+-+Prezzo+23423<Br%2F><br%2F><br%2F><b>Riepilogo+ordine+adesivo<%2Fb>+<br%2F><br%2F>Layout+selezionato%3A+<b>3<%2Fb><br%2F>Colore+primario+%3A+%238c4747<br%2F>Colore+secondario%3A+%23943939<br%2F>Address+%3A+asd<br%2F>Phone+%3A+asd<br%2F>Email+%3A+asd%40asd.com<br%2F>Website+%3A+asdasd<br%2F>Indirizzo+Spedizione++%3A+asdasd<br%2F>Indirizzo+%3A+asd<br%2F>Telefono+%3A+asd<br%2F>Email+%3A+asd%40asd.com<br%2F>Sito+web+%3A+asdasd<br%2F>
我正在重定向到此页面,之前打印过该消息,但现在没有打印。
我的网址就像:
site.com?message=thisismymessage
它正常工作,但当消息等于
时 message=<b>Volatino+riepilogo+ordine%3A<%2Fb>+<br%2F>+<br%2F>Layout+selezionato%3A+<b>2<%2Fb><br%2F>Slogan+%3A+asd<br%2F>Testo+descrittivo+offerta+%3A+asdasd<br%2F>Indirizzo+%3A+asd<br%2F>Telefono+%3A+asdsd<br%2F>Email+%3A+asd<br%2F>Sito+web+%3A+asd<br%2F>Colore+primario%3A+%23e6a1a1<br%2F>Colore+secondario%3A+%23b36868<br%2F>1-+Prodotto+asd+-+Prezzo+23423<Br%2F><br%2F><br%2F><b>Riepilogo+ordine+adesivo<%2Fb>+<br%2F><br%2F>Layout+selezionato%3A+<b>3<%2Fb><br%2F>Colore+primario+%3A+%238c4747<br%2F>Colore+secondario%3A+%23943939<br%2F>Address+%3A+asd<br%2F>Phone+%3A+asd<br%2F>Email+%3A+asd%40asd.com<br%2F>Website+%3A+asdasd<br%2F>Indirizzo+Spedizione++%3A+asdasd<br%2F>Indirizzo+%3A+asd<br%2F>Telefono+%3A+asd<br%2F>Email+%3A+asd%40asd.com<br%2F>Sito+web+%3A+asdasd<br%2F>
$_GET
没有任何价值,即使print_r($_GET)
的输出也是一个空数组。
答案 0 :(得分:0)
编码url, 或试试这个:
$uri = $_SERVER['REQUEST_URI'];
$arr = explode('=', $uri);
$message = '';
foreach( $arr as $k => $v ){
if( stripos($v, 'message') !== false ){
$message = $arr[$k+1];
break;
}
}
var_dump($message);exit;
&#13;