【发布时间】:2018-05-05 05:32:20
【问题描述】:
我需要帮助 我有一个带有输入文本的表单
<?php
if($input == ‘aab’ or ‘aac’){
$action = " http://mywebsite.com /women/search=$input";
}else if($input == ‘aad’ or ‘aaf’ or ‘aat’){
$action =" http://mywebsite.com /men/search=$input”;
}
?>
<form action= "<?php echo $action; ?>" method="post">
<input id="Input" name="Input" class="input-block-level "></p>
<p class="pull-right" ><button id="Search" class="btn" > Search
</form>
它有两个不同的动作,例如如果输入文本以 aab 或 aac 开头,那么它将提交给http://mywebsite.com /women/search=$input 如果输入文本值以 aad 或 aaf 或 aat 开头,则动作将是 到http://mywebsite.com /men/search=$input 所以首先我们将检查输入是否以 aab 或 aac 或 aad 或 aat 开头...然后 subit 到正确的 url
【问题讨论】:
-
‘’- 巧妙的引语,美丽而致命。 -
你有双重
$$..请告诉我上面是伪代码 -
您的
else if毫无意义且无效。你的整个帖子都站不住脚。 -
'' 和 $$, == == in else if 无效,没有意义
-
我一个,不会重写你的代码;我出去了。
标签: php jquery html forms validation