<?php //---------------------------用户自定义标签文件
//验证是否显示手机所属 function user_belonging($id) { global $empire,$dbtbpre,$navinfor; $id=$navinfor['id']; $r=$empire->fetch1("select phone from hsrenecms_fangchan where id=$id"); $number=trim($r['phone']); if ($number) { $expr="^1[35][0-9]{9}$"; $Results=ereg($expr,$number); //验证号码是否正确 if ($Results==1) { $lent = sub ($number, 0, 7, false); $return=' <img src="/images/mobile.gif" alt="手机归属地查询" width="15" height="16" /><a href="#mobi" onclick="MyOnchange(\'/e/key/mobile_search.php?id='.$lent.'\',document.getElementById(\'ShowTel\'));"><span class="px10">手机归属地查询</span></a>'; } else { $return=''; } } else { $return=''; } echo $return; } 怎么改成自动识别表啊? 按WC的改过 <?php //---------------------------用户自定义标签文件
//验证是否显示手机所属 function user_belonging($id,$tbname) { global $empire,$dbtbpre,$navinfor; $id=$navinfor['id']; $r=$empire->fetch1("select phone from hsrenecms_" . $tbname ." where id='$navinfor[id]'"); 还是出现错误!审核信息部分出问题!
|