jQuery+php+DLE
Здравствуйте
Пожалуйста не нужно писать что таких тем, полно, у меня в гугле все сылки фиолетовые, я уже не знаю что делать...... Суть такова: CMS = DLE; при разработке модуллей в дле можно использовать зарезервированный массив $member_id, есть файл main.tpl ...... <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="/engine/modules/lol/teampanel.js"></script> ..... <div class="t11" id="t11"></div> <div class="t12" id="t12"></div> <div class="t13" id="t13"></div> <div class="t14" id="t14"></div> <div class="t15" id="t15"></div> ...... Файл teampanel.js
$(document).ready(function(){
$('.t11,.t12,.t13,.t14,.t15,.t21,.t22,.t23,.t24,.t25').click(function(){
var clickid = $(this).attr('id');
$(this).addClass('t33');
$.ajax({
url:"/engine/modules/lol/teamqq.php",
type:"GET",
data: {action:clickid},
success: function(data){
$('.t33').html(data);
},
error: function(){$('.t33').html('error')}
});
});
});
Файл teamqq.php
<?php
$action = ((isset($_GET['action'])) ? $_GET['action'] : "");
function hello() {
echo $member_id['name'];
}
switch($action) {
case "t11":
hello();
break;
}
?>
смотрю в монитор уже енннный день - не вижу ошибки, перепробовал кучу разных методов, все равно не пойму почему не выводиться "логин". Пробовал ставить вместо $member_id['name'] просто слова\цыфры - выводит, пробовал писать echo $member_id['name'] в голом php и подключать к main.tpl - выводит, В чем проблема непойму |
<?php
$action = ((isset($_GET['action'])) ? $_GET['action'] : "");
function hello($member_id) {
echo $member_id['name'];
}
switch($action) {
case "t11":
hello($member_id);
break;
}
?>
или
<?php
$action = ((isset($_GET['action'])) ? $_GET['action'] : "");
function hello() {
global $member_id;
echo $member_id['name'];
}
switch($action) {
case "t11":
hello();
break;
}
?>
|
http://s005.radikal.ru/i209/1309/bc/ac49b556f71a.jpg
непомогло, причем из-за null я думаю что проблема с $member_id переписал в teamqq.php работу с базой, теперь все ок, проблема была с $member_id |
| Часовой пояс GMT +3, время: 19:30. |