pouncer Posted November 8, 2006 Share Posted November 8, 2006 [code=php:0] <div align="left"> <p align="center"><span class="style45"><br> <span class="style46">Username:<br> </span></span> <input name="txt_Username" type="text" class="style15" id="txt_Username"> <br> <span class="style47">Password:</span><br> <input name="txt_Password" type="password" class="style15" id="txt_Password"> <br> <br> <input name="frmLogin_Submit" type="submit" class="style11" id="frmLogin_Submit" value="Login"> <br> <span class="style47"><a href="forgot_password.php" style="color:#ffffff">Forgot your password? </a></span></p> </div>[/code]basically i want to disable all of that div section, but unsure how?if ($log->IsLoggedIn() == true) {//disable that div section}else {//whatever..}anyway got any ideas? Link to comment https://forums.phpfreaks.com/topic/26624-disable-a-div-area-with-php/ Share on other sites More sharing options...
wwfc_barmy_army Posted November 8, 2006 Share Posted November 8, 2006 Could you not just put the div code into the If statement something like:[code=php:0]if ($log->IsLoggedIn() == true) {}else { <div align="left"> <p align="center"><span class="style45"><br> <span class="style46">Username:<br> </span></span> <input name="txt_Username" type="text" class="style15" id="txt_Username"> <br> <span class="style47">Password:</span><br> <input name="txt_Password" type="password" class="style15" id="txt_Password"> <br> <br> <input name="frmLogin_Submit" type="submit" class="style11" id="frmLogin_Submit" value="Login"> <br> <span class="style47"><a href="forgot_password.php" style="color:#ffffff">Forgot your password? </a></span></p> </div>}[/code] Link to comment https://forums.phpfreaks.com/topic/26624-disable-a-div-area-with-php/#findComment-121794 Share on other sites More sharing options...
pouncer Posted November 8, 2006 Author Share Posted November 8, 2006 i dont think so because the div stuff is html code Link to comment https://forums.phpfreaks.com/topic/26624-disable-a-div-area-with-php/#findComment-121860 Share on other sites More sharing options...
wwfc_barmy_army Posted November 8, 2006 Share Posted November 8, 2006 Good Point, You could save it in a seperate file, and recall it using include instead of the html code. Link to comment https://forums.phpfreaks.com/topic/26624-disable-a-div-area-with-php/#findComment-121861 Share on other sites More sharing options...
roopurt18 Posted November 9, 2006 Share Posted November 9, 2006 [code]<?phpif ($log->IsLoggedIn() == true) {}else { ?> <div align="left"> <p align="center"><span class="style45"><br> <span class="style46">Username:<br> </span></span> <input name="txt_Username" type="text" class="style15" id="txt_Username"> <br> <span class="style47">Password:</span><br> <input name="txt_Password" type="password" class="style15" id="txt_Password"> <br> <br> <input name="frmLogin_Submit" type="submit" class="style11" id="frmLogin_Submit" value="Login"> <br> <span class="style47"><a href="forgot_password.php" style="color:#ffffff">Forgot your password? </a></span></p> </div> <?}?>[/code]You can jump in and out of PHP mode. For the record, I don't particularly like this approach, but you can do it! Link to comment https://forums.phpfreaks.com/topic/26624-disable-a-div-area-with-php/#findComment-121927 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.