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> ";
echo "<INPUT type=\"submit\" name=\"add\" value=\" \" 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
精彩评论