我随机生成了32个字符的哈希值,如下所示:
bB6UqEQvJ78ryklsKF9xpW3mtZjTVaD2
我想在我的jscript函数中使用它们来获取新位置。 (用于重定向各种页面)
这是我的剧本:
<script>function choose(e){$("#dialog-choose").dialog({resizable:false,height:300,width:400,modal:true,buttons:{"<?php echo $pop_create_offer ?>":function(){window.location.replace("index.php?content=create_offer&id="+e)},"<?php echo $pop_transfer_item ?>":function(){window.location.replace("index.php?content=transfer_item&id="+e)},"<?php echo $pop_cancel ?>":function(){$(this).dialog("close")}}})}</script>
<div style="display:none;" id="dialog-choose" title="<?PHP echo $pop_confirmation; ?>">
<div class="dialog"><span class="ui-icon ui-icon-alert" style="float:left;margin:0 7px 20px 0;"></span><?php echo $pop_storehouse_1_q ?></div>
<div class="dialog"><?php echo $pop_storehouse_2_q ?></div>
<div class="dialog"><?php echo $pop_storehouse_3_q ?></div>
</div>
<?PHP
echo $admin_tit_coupon_list;
if(isset($_GET['p']) && check_integer($_GET['p'])) {
$page=$_GET['p'];
} else {
$page=1;
}
$max_stuff=50;
$min_stuff=($page-1)*$max_stuff;
$rows=mysql_query("SELECT * FROM auction_house.coupons");
$total_page=ceil(mysql_num_rows($rows)/$max_stuff);
$execute=mysql_query("SELECT * FROM auction_house.coupons LIMIT ".$min_stuff.",".$max_stuff."");
if(mysql_num_rows($rows)>0) {
echo'<table style="font-size:12px;"><th>'.$admin_coupon_hash.'</th><th>'.$admin_coupon_type.'</th><th>'.$admin_coupon_value.'</th><th>'.$admin_coupon_availability_last.'</th><th>'.$admin_coupon_create_date.'</th>';
while($array=mysql_fetch_array($execute)) {
echo'<tr align="middle" onclick="choose('.$array["hash"].')" style="cursor:pointer;cursor:hand">';
echo'<td>'.$array["hash"].'</td>';
if($array["type"]=='item') {
echo'<td>'.$admin_coupon_type_item.'</td>';
} else {
echo'<td>'.$admin_coupon_type_discount.'</td>';
}
echo'<td>'.$array["value"].'</td>';
echo'<td>'.$array["last_validate"].'</td>';
echo'<td>'.$array["create_date"].'</td>';
echo'</tr>';
}
echo'</table>';
if($page>1) {$result=($page-1); echo'<a href="index.php?content=admin&page=show_logs_all&p='.$result.'"><div class="arrow_page left_arrow_page" title="'.$des_last_page.'"></div></a>';} else {echo'<div class="arrow_page left_arrow_page_e" title="'.$des_last_page.'"></div>';}
if($page<$total_page) {$result=($page+1); echo'<a href="index.php?content=admin&page=show_logs_all&p='.$result.'"><div class="arrow_page right_arrow_page" title="'.$des_next_page.'"></div></a>';} else {echo'<div class="arrow_page right_arrow_page_e" title="'.$des_next_page.'"></div>';}
} else {
echo $err_there_is_no_item;
}
?>
但是这个jscript不起作用,chrome给了我这些错误:
Uncaught SyntaxError: Unexpected token ILLEGAL
Uncaught ReferenceError: cw9hDVKTqCosYSOx1fJI3lHaRbGZPBnL is not defined
Uncaught SyntaxError: Unexpected token ILLEGAL
Uncaught ReferenceError: cw9hDVKTqCosYSOx1fJI3lHaRbGZPBnL is not defined
Uncaught ReferenceError: fmFS9GsPnHZvWhEurAxakKN1j8q6JeDt is not defined
Uncaught ReferenceError: fFNtiGX7ErqRpahjZTuC62MOndPveDLS is not defined
Uncaught ReferenceError: cw9hDVKTqCosYSOx1fJI3lHaRbGZPBnL is not defined
Uncaught ReferenceError: bB6UqEQvJ78ryklsKF9xpW3mtZjTVaD2 is not defined
当我缩短哈希脚本工作时。在32个字符中,不起作用......