[英]I want to get the username of the teacher when i redirect to the message page
kindly help me i am stuck on this issue. 请帮我解决这个问题。 when a student click on "Ask Question" button then the student will redirect to the message page but i want that when the student will redirect then the username of the specfic teacher will appears on the compose message script.
当学生单击“问问题”按钮时,该学生将重定向到消息页面,但是我希望当该学生将重定向时,特定教师的用户名将出现在撰写消息脚本中。
<?php if($usertype == "Student") { ?>
<td data-title="<?=$this->lang->line('action')?>">
<a href="<?=base_url("mark/view")?>"><input type="submit" class="btn btn-success btn-view" style="margin-bottom:10px" value="View Marks" ></a>
<a href="<?=base_url("message/add")?>"><input type="submit" class="btn btn-success" style="margin-bottom:0px" value="Ask Questions"></a>
</td>
<?php } ?>
the table of teacher with respect to the subjects are 关于主题的教师表是
<td data-title="<?=$this->lang->line('subject_teacher')?>">
<?php echo $subject->teacher_name; ?>
</td>
kindly help me to solve this issue. 请帮助我解决这个问题。 Thanks in advance
提前致谢
I would use a cookie, personally. 我个人会使用cookie。 Like this:
像这样:
setcookie("teacher", $teacher_name);
Then you can access the cookie like this: 然后,您可以像这样访问cookie:
$teacher = $_COOKIE["your cookie name"];
More information can be found here: 更多信息可以在这里找到:
http://php.net/manual/en/features.cookies.php http://php.net/manual/en/features.cookies.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.