我正在尝试将玩家列出到页面中,该页面已经使用了sql查询,因此我将此查询放入了一个函数(如下),该函数位于functions.php中,在另一个文件teampage.php中,我称之为函数import tkinter as tk
class ButtonSunken:
def __init__(self):
self.tags = ('A','B','C','D','E','F')
self.buttons = []
self.active = None
self.win = tk.Tk()
self.create_buttons()
self.win.mainloop()
def create_buttons(self):
for j,i in enumerate(self.tags):
self.buttons.append(tk.Button(self.win, text=i, command=lambda x=j: self.button_pressed(x)))
self.buttons[-1].grid(column=0, row=j)
def button_pressed(self, idx):
if self.active is not None:
self.buttons[self.active].configure(relief='groove')
self.buttons[idx].configure(relief='sunken')
self.active = idx
t_object = ButtonSunken()
,但是它抛出了<?php echo listGoalkeepersForTeam(); ?>
如何获取读取teampage.php的功能? id = 1 并相应显示信息。
Notice: Undefined variable: id in C:\xampp\***\functions.php on line 77
答案 0 :(得分:1)
您没有从GET变量获取ID。
function listGoalkeepersForTeam() {
//insert line
$id = filter_input(INPUT_GET, 'id');
....