1、在<head>中加入
<script src=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"{dede:global.cfg_cmsurl/}/include/dedeajax2.js"type=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"text/javascript" ></script>
<script language=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"javascript">
function CheckLogin_c(){
var taget_obj = document.getElementById('_userlogin_c');
var req = document.getElementById('hid').value;
myajax = new DedeAjax(taget_obj,false,fal se,'','','');
myajax.SendGet2("{dede:global.cfg_cmspath/}/member/ajax_loginsta_c.php?val="+req);
DedeXHTTP = null;
}
</script>
<span id=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"_userlogin_c">
购买链接(未登录时候显示):{dede:field.url1/}<br />
市场价格(未登录时候显示):{dede:field.jiage1/}<br />
</span>
<input type=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"hidden" value=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"{dede:field.aid/}" id=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"hid" />
<script language=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"javascript" type=http://www.dede58.com/a/zhimengjiaocheng/dedefault/"text/javascript">CheckLogin_c();</script>
查看源码
打印代码帮助
<?php
/**
* @version $Id: ajax_loginsta.php 1 8:38 2010年7月9日Z tianya $
* @package DedeCMS.Member
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license
* @link
*/
require_once(dirname(__FILE__)."/config.php");
AjaxHead();
if($myurl == '') exit('');
$uid = $cfg_ml->M_LoginID;
!$cfg_ml->fields['face'] && $face = ($cfg_ml->fields['sex'] == '女')? 'dfgirl' : 'dfboy';
$facepic = empty($face)? $cfg_ml->fields['face'] : $GLOBALS['cfg_memberurl'].'/templets/images/'.$face.'.png';
?>
<?php
$rank=$cfg_ml->M_Rank;
$row = $dsql->GetOne(" Select * From `dede_addon19` where `aid`=$val ");
?>
购买链接(已登录):<?php echo $row['url2'];?><br />
本店价格:<?php echo $row['jiage2'];?><br />