Jump to content

disable a 'div' area with php


pouncer

Recommended Posts

[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
Share on other sites

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
Share on other sites

[code]<?php

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]

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.