小编Cha*_*iff的帖子

检查多个strpos值

我想知道如何完成多个strpos检查.

让我澄清一下:
我想要strpos来检查变量"COLOR"以查看变量中是否存在1到8之间的任何数字.如果存在从1到8的任何数字,我想回显"已选择".

例子:
比方说,只有数字1是变量,它 "选择"呼应.
比方说,数字1 2和3是在变量,它回声"选择".
比方说,数字3 9月25日都在变,这回声"选择"(因为那3!).
假设只有数字9在变量中,它不会回显.
假设数字9 25 48在变量中,它不会回显.

php strpos

5
推荐指数
3
解决办法
3万
查看次数

询问您是否确定要提交?JavaScript的?

我现在有这个.

 //other stuff up here - not important
    echo "<td><form action='redeem.php' method='post' id='form'><input type='hidden' name='redeem' value='1' /><input type='hidden' name='id' value='" . $id . "' /><input type='submit' name='Redeem' value='Redeem'></form></td>";
    } else {
    echo "<td><form action='redeem.php' method='post' id='form'><input type='hidden' name='redeem' value='0' /><input type='hidden' name='id' value='" . $id . "' /><input type='submit' name='Un-Redeem' value='Un-Redeem'></form></td>";
//other stuff down here - not important
Run Code Online (Sandbox Code Playgroud)

我想改变它,以便当您按下:
a)"兑换"提交按钮时,它会提醒您说:"您确定要兑换吗?"
b)"Un-Redeem"SUBMIT按钮,它会提醒您:"您确定要取消兑换吗?"

我已经尝试了其中一些,包括提交上的ONCLICK,但没有一个工作..我相信这是因为我在ECHO中有它,我不得不删除阻止该功能发生的(")引号.

有人知道我能做到的另一种方式吗?

javascript php forms alert submit

1
推荐指数
2
解决办法
8921
查看次数

标签 统计

php ×2

alert ×1

forms ×1

javascript ×1

strpos ×1

submit ×1