Ask God for help and see what's wrong.

Source: Internet
Author: User
if (!isset ($_session["SN"])) {$_session[' sn ']=0;setcookie (' sn ', $SN, Time () +1);    if ($_post["submit"]) {if ($sn =3) {

Alert ("Sorry, you have clicked 3 times"); location.href= "zp.php";

Exit ();} ElseIf ($SN = = "Tull") {

Alert ("123"); location.href= "zp.php";

Exit ();} $newitem =$_post["Zp_user"]; $sql = "INSERT into vote (Awards,sn,pnone) VALUES (1, ' $sn ', 1)"; if (mysql_query ($sql)) {    $SN ==$_session[' sn ']+1;}} if ($_post["Submit2"]) {if (Empty ($_post[' sn ')) $_session[' Zp_user ']=$_post[' Pnone ']; $sql = "INSERT INTO Zp_user VALUES (' ". ( $_post[' SN '). "')"; if (mysql_query ($sql)) {}}}

Reply to discussion (solution)

if (mysql_query ($sql))
$SN ==$_session[' sn ']+1;

Why use = =?

The code is all separate, so it's hard to see ...

if ($_post["submit"]) {
if ($SN =3)
should be = =

if ($_post["submit"]) {
if ($SN =3)//= =

= is a value assignment
= = If condition is used to judge

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.