使用ajax刷新div的问题

时间:2016-09-19 21:02:09

标签: php jquery html ajax

昨天我在ajax中找到了刷新div的代码。问题是:

他的div令人耳目一新,使得PHP代码中的ifs无效。

你们能告诉我如何让它全部发挥作用吗?

PHP CODE(带有if的片段):

# Get column with the dates 
dates = df.iloc[:,0].values
year_attacks = {}
for date in dates:
    # Get year from the date
    year=str(date).split('-')[0]
    # If year is already in the dictionary increase number of attacks by 1
    if year in year_attacks:
       year_attacks[year]=year_attacks[year]+1
    # Else create new key
    else:
       year_attacks[year]=1

AJAX代码:

if($iddodawacza==$_SESSION['id'] or($_SESSION['admin']=="1")){
    echo '<a href="usuwaniepostu.php?id='.$output['id'].'">Usuń post</a>';
}

0 个答案:

没有答案
相关问题