使用php和mysql在iFrame V2中显示特定的URL

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了使用php和mysql在iFrame V2中显示特定的URL脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我是sqlPHP新手,需要以下问题的帮助.

我有一个sql数据库,例如,“用户名,密码,国籍,类”,我想要做的是,一个简单PHPSQL查询,它将从数据库检查用户的类字段并在指定的地方显示相应的URL iFrame(例如,类是J1,J2,J3,如果字段已经包含J3,那么在加载时显示相应的URL,没有任何用户输入.(所有都将提前决定)

您可以将其视为学生档案,一旦学生成登录,查询将读取班级字段,并根据找到的内容,它将返回具有正确链接的可点击URL.

对于我现在的水平来说,这太难了,希望有人可以对我有了解.

这是用户成功登录后的代码.

<!-- NOTIFICATIONS STARTS HERE -->
<?PHP
require_once('connection.PHP');
$id=$_SESSION['SESS_MEMBER_ID'];
$result3 = MysqL_query("SELECT * From member where mem_id='$id'");
while($row3 = MysqL_fetch_array($result3))
{ 
$fname=$row3['fname'];
$country=$row3['country'];
$class=$row3['class'];
$headteacher=$row3['headteacher'];
$attendance=$row3['attendance'];
$homework=$row3['homework'];
$messageparents=$row3['messagestudent'];
}
?>
<table width="468" border="0" align="center" cellpadding="0">
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS">
<table width="468" border="0" align="center" cellpadding="0">
<tr>
<td class="FONTS"><div align="left" class="FONTS"><b>名前:</b></div>
<?PHP echo $fname ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>国:</b></div>
<?PHP echo $country ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>クラス:</b></div>
<?PHP echo $class ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>家庭教師の先生:</b></div>
<?PHP echo $headteacher ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>出席率:</b></div>
<?PHP echo $attendance ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>宿題率:</b></div>
<?PHP echo $homework ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>先生からメッセージ:</b>            
</div>
<?PHP echo $messagestudent ?></td>
</tr>
</table>
</div></td>
</tr>
</table>
<p align="center" class="FONTS"><a href="index.PHP">ログアウト</a></p>
<!-- NOTIFICATIONS ENDS HERE -->

它已经按预期工作,所以我不会改变它,除非它是完全必要的,我只需要能够显示该URL链接.

提前致谢!

解决方法

<?PHP
if($class=='J1')
echo "<a href='www.First_url.COM'>Click Here</a>";
else if($class=='J2')
echo "<a href='www.second_url.com'>Click Here</a>"; 
..............
?>

脚本宝典总结

以上是脚本宝典为你收集整理的使用php和mysql在iFrame V2中显示特定的URL全部内容,希望文章能够帮你解决使用php和mysql在iFrame V2中显示特定的URL所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。