Need help with sessins: adding html

Discussion in 'PHP' started by saturn100, Nov 25, 2011.

  1. #1
    Hi
    I have been working with sessions and creating a membership site
    It all working OK I followed a tutorial online but for the life of me I cant figure out how to create a regular webpage with the method

    Basically when the user logs in it goes to member.php and they get a welcome message that is echoed out but I need to ad in a form for them (the users ) to fill out
    I tried placing the html in the echo and got error messages also tried adding $html but nothing
    Can anyone help at the moment I I need a html form aded
    It is for internal use at the moment so i dont need a fancy design but would like to know how for future references how to add session to a proper html/css webpage but the form with do for now

    the code I have for the member page is

    <?php
    
    session_start ();
    
    if ($_SESSION['username']){
    
    echo "welcome, ".$_SESSION['username']."! <br><br>
    Please fill out this form an send it.";
    
    }
    
    
    
    else
    die ("please log in");
    
    ?>
    
    
    
    PHP:
     
    saturn100, Nov 25, 2011 IP
  2. saturn100

    saturn100 Well-Known Member

    Messages:
    465
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    111
    #2
    never mind murphy's law
    I just had a urica moment with it
    Sill however getting an error messgae when you log out and try to revist the page

    Notice: Undefined index: username in C:\wamp\www\password\member.php on line 5

    any ieas
     
    saturn100, Nov 25, 2011 IP