简体   繁体   中英

Hide and show divs using PHP

So I have this code that requires to be a member. Now the question is what code do I add to hide two different divs called "socialsignup" and "formwrap". Another question is can you have multiple <?php code here ?> s in different places on the same page? Much appreciated with any help.

<?PHP
require_once("./include/membersite_config.php");

if(!$fgmembersite->CheckLogin())
{
$fgmembersite->RedirectToURL("login.php");
exit;
}
?>

You can wrap multiple time of PHP tags in a page. That's answer for your fisrt and second question. You can check like this

<?php if($val=='socialsignup') {?>
html for the social sign up  
<?php } else if ($val=='formwrap') {?>
html for formwrap
<?php }else{?>
remaining conditions
<?php } ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM