#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Notice: Undefined index: user_log in C:\wamp\www\library\top.php on line 23


    <script type="text/javascript" src="javascript/mootools.js"></script>
    <script type="text/javascript" src="javascript/visualslideshow.js"></script>
    <link rel="stylesheet" type="text/css" href="slideshow.css" media="screen" />
    <style type="text/css">.slideshow a#vlb{display:none}</style>

    <div id="show" class="slideshow">
    <div class="slideshow-images">
    <a href=""><img id="slide-0" src="data/images/dsc00108.jpg" alt="ETF Building" title="dsc00108" /></a>
    <a href=""><img id="slide-1" src="data/images/017.jpg" alt="School Gate" title="School Gate" /></a>
    <a href=""><img id="slide-2" src="data/images/020.jpg" alt="Senate Biulding" title="Senate Biulding" /></a>
    <a href=""><img id="slide-3" src="data/images/022.jpg" alt="School Mosque" title="School Mosque" /></a>
    <a href=""><img id="slide-4" src="data/images/admin.jpg" alt="Administrative Building" title="Administrative Building" /></a></div>
    </div>
    <div class="top">
    <div class="menus">
    <div class="menu"><a href="index.php">HOME</a></div>
    <div class="menu"><a href="about.php">ABOUT</a></div>
    <div class="menu"><a href="index.php">LIBRARY</a></div>
    <div class="menu"><a href="search_form2.php">SEARCH</a></div>
    <div class="menu"><a href="help.php">HELP</a></div>
    <p align="right" style="padding-right:10px">
    <?php
    $user_log = $_SESSION['user_log'];
    if (isset($_SESSION['user_log'])){
    echo "<a href='#' style='color:#FFC'>Welcome $_SESSION[username] </a> || <a href='logout.php' style='color:#FFC'>Logout</a>";
    }
    else{
    echo "<a href='login.php' style='color:#FFC'>Sign In</a>";
    }
    ?>
    </p>
    </div>


    I cant locate the error. Please help
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,997
    Rep Power
    9397
    PHP Code:
    $user_log $_SESSION['user_log'];
    if (isset(
    $_SESSION['user_log'])){ 
    You try to use the value before you verify it even exists. And actually you don't even use $user_log.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0
    Please, do you have somewhere i can send u the entire project because am new to PHP and it has several errors that needs correction before i can present it in school. Abd plese explain to me what I should do. (sounds kinda of stupid to ask)
  6. #4
  7. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,997
    Rep Power
    9397
    Neither I nor anyone here will do the work for you. But if you're okay with posting the problems you come across we'll try to help you fix them.
  8. #5
  9. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,853
    Rep Power
    6351
    You have a variable that you use:
    $user_log = $_SESSION['user_log'];

    That variable doesn't exist, so you get the error.

    You then immediately verify if it exists:
    if (isset($_SESSION['user_log'])){

    Move the "using" bit after the "checking" bit to remove the error.

    However, this entire exercise is moot because you never use this variable at all other than trying to see if it's there. You don't take any actions with it.

    Like Requinix said, we don't do work for free. We can help you do your work better, but if you want someone to do this for you, post in the hire-a-programmer forum and shell out some money.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo