Welcome Guest, Not a member yet? Register   Sign In
edit and add logic
#5

Maybe this will help:

PHP Code:
<div id="login">
    
    <?
php if(empty($username)) { ?>
    <h2>Register</h2>
    <?php } else { ?>
    <h2>Update</h2>
    <?php ?>
    
    <div class="box">
            <form method="post">
            <?php if(empty($username)) { ?>
            Username:<br />
            <input type="text" name="username" size="50" class="form" value="<?php echo set_value('username'); ?>" /><br /><?php echo form_error('username'); ?><br />
            Password:<br />
            <input type="password" name="password" size="50" class="form" value="<?php echo set_value('password'); ?>" /><?php echo form_error('password'); ?><br /><br />
            Password confirmation:<br />
            <input type="password" name="conf_password" size="50" class="form" value="<?php echo set_value('conf_password'); ?>" /><?php echo form_error('conf_password'); ?><br /><br />
            <?php ?>
            Email:<br />
            <?php if(empty($username)){ ?>
                <input type="text" name="email" size="50" class="form" value="<?php echo set_value('email'); ?>" /><?php echo form_error('email'); ?><br /><br />
            <?php }else{ ?>
            <input type="text" name="email" size="50" class="form" value="<?php echo set_value('email'$email); ?>" /><?php echo form_error('email'); ?><br /><br />
            
            <?php } if(empty($username)) { ?>
            <input type="submit" value="Register" name="register" />
            <?php } else { ?>
            <input type="submit" value="Update" name="register" />
            <?php ?>
            </form>
    </div>
</div> 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
edit and add logic - by davy_yg - 06-23-2016, 04:42 AM
RE: edit and add logic - by JayAdra - 06-23-2016, 04:48 AM
RE: edit and add logic - by Martin7483 - 06-23-2016, 05:59 AM
RE: edit and add logic - by davy_yg - 06-23-2016, 06:36 AM
RE: edit and add logic - by InsiteFX - 06-23-2016, 11:20 AM
RE: edit and add logic - by ivantcholakov - 06-23-2016, 02:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB