如果 mysql 字段完整,则用于重定向的 PHP 代码 [英] PHP code to redirect if mysql field is complete

查看:27
本文介绍了如果 mysql 字段完整,则用于重定向的 PHP 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个页面,如果有人已经输入了他们的数据,它会将他们重定向到一个页面,其中显示抱歉,您已经做出了选择".最简单的字段是出席率1,其中值是是"或否",因此如果它是这些值之一,它将重定向到我想要的页面.我的页面代码在这里:http://pastebin.com/1D6PrmBv

I would like to create page that if someone has already entered their data it redirect them to a page where it says 'sorry you have already made your selection'. The easiest field would be attendance1 where the value is either a 'Yes' or a 'No' so if it is either one of these values it will redirect to the page i want. Code for my page is here: http://pastebin.com/1D6PrmBv

推荐答案

include('connect.inc');
if (isset($rows['food'])) {
    header(location: mypagelocation.html');
    exit;
}
else{
    // $rows['food'] is not set
}

这篇关于如果 mysql 字段完整,则用于重定向的 PHP 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆