Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果第一次用户登陆页面显示表单号,我想显示两个带有 cookie 的表单。1和第二次登陆显示表格2如果第三次没有表格显示请帮助我
我不认为你需要两个饼干。您可以只使用一个 cookie 并将其称为“访问”。
if ( !isset( $_COOKIE['visits'] ) ) { $_COOKIE['visits'] = 0; // display form no. 1 } elseif ( $_COOKIE['visits'] == 1 ) { // form no. 2 } else { // no form } $_COOKIE['visits'] ++;