在php中将参数hashtag发送到另一个页面
我在HTTP请求中使用带有值hashtag(#)的send参数时遇到问题 我有一个matcontents的例子是在php中将参数hashtag发送到另一个页面,php,Php,我在HTTP请求中使用带有值hashtag(#)的send参数时遇到问题 我有一个matcontents的例子是#3232,然后我需要用该值发送参数。我试过这样做: echo "<td width=25% align=left bgcolor=$bgcolor id='title'> <font face='Calibri' size='2'> <a href='../report/rptacc_det.php?kode
#3232
,然后我需要用该值发送参数。我试过这样做:
echo "<td width=25% align=left bgcolor=$bgcolor id='title'> <font face='Calibri' size='2'>
<a href='../report/rptacc_det.php?kode=$brs3[matcontents]&fromd=$fromd2&tod=$tod2&type=$type&fty=$fty&nama=$brs3[itemdesc]' target='_blank'>
$brs3[matcontents]</a></font></td>";
echo”
";
但是当我在rptacc_det.php上给kode打电话时,我什么也没有得到,或者是空白。如何将“#3232”之类的值发送到另一个页面???在请求中未将#
发送到服务器后的任何操作,因为它被解释为页面上的锚定位置
发送它们是可能的,但您需要发送它们
您应该对URL中包含的所有变量执行此操作 请我知道我的句子有点糟糕,但是,请回答我的问题!!!var urlspilt=document.URL.split(“#”);location.href=“”+”/“+urlspit[1]@VforVendetta你的意思是我需要使用javascript???是的,你可以尝试其他方式
$kode = "this is a #test";
// Does not work:
// In the following, $_GET['parameter'] will be "this is a ";
// link will be '?kode=this is a #test'
echo '<a href=../report/rptacc_det.php?kode' . $kode . '>Click</a>';
// Works:
// In the following, $_GET['parameter'] will contain the content you need
// link will be '?kode=this%20is%20a%20%23test'
echo '<a href=../report/rptacc_det.php?kode' . urlencode($kode) . '>Click</a>';
$kode = urldecode($_GET['kode']);