开发者

Input button hide based url

开发者 https://www.devze.com 2023-03-15 01:03 出处:网络
I am trying to hide an input button hide when the specific URL product_catalo开发者_Python百科g.php?c=12 is loaded.

I am trying to hide an input button hide when the specific URL product_catalo开发者_Python百科g.php?c=12 is loaded.

Here is my button code in product_catalog.php:

echo "<INPUT type=\"text\" name=\"qty\" size=2 value=\"1\" class=\"text-pc\"><span class=\"small2\">kpl</span>&nbsp;";
echo "<INPUT type=\"submit\" name=\"add\" value=\"&nbsp;\" id=\"lisaa\" class=\"add-to-basket\">";

How do I hide it if the user is browsing product_catalog.php?c=12?


Use a simple if statement to check if $_GET['c'] is not equal to 12:

if($_GET['c'] != '12') {
  // put your echo statements here.
}

Note that this is a fairly simple question about a base control structure of PHP. You might want to learn more about control structures by reading the PHP Manual before continuing with your project.

Concepts touched in this answer:

PHP Manual: Control Structures
PHP Manual: if
PHP Manual: Superglobals

0

精彩评论

暂无评论...
验证码 换一张
取 消