For some reason my script is changing a session.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ajm113
    New Member
    • Jun 2007
    • 161

    For some reason my script is changing a session.

    I find it odd all my scripts doesn't change the logged in person's name on any other page, but my threads page. I have no idea why! I looked over the script and saw nothing changing the session (Variable Wise) changing it.

    I commented out some off the parts on my large script, but it seems the problem points to here though it doesn't make sence.

    It looks it's changing the myemail session.
    [PHP]<?
    if(@$_SESSION['myemail'] != "") {


    print "<a href=\"login.ph p?type=logout\" >Log Out</a> | <a href=\"account. php\">Account Settings</a>";

    $link2=mysql_co nnect('localhos t','root','pass word');

    mysql_select_db ('accountdb');

    $email32 = $_SESSION['myemail'];

    $query = "SELECT * FROM accountTbl WHERE email='$email32 '";
    $result = mysql_query($qu ery, $link2) or die(mysql_error ());

    $row = mysql_fetch_arr ay( $result) or die(mysql_error ());


    $avatar = $row['avatar'];
    $email = $row['email'];
    $myPower = $row['power'];
    $points = $row['points'];
    $myId1 = $row['id'];

    if($avatar == ""){
    $avatar = "http://img1.jurko.net/avatar_5450.jpg ";
    }

    echo "<br><br>Welcom e $email <br>" .
    "points: $points <br><br>" .
    "Avatar:<br > <img src=\"$avatar \" width=\"100px\" height=\"100px\ "><br><br>" ;

    //......

    ?>[/PHP]
  • realin
    Contributor
    • Feb 2007
    • 254

    #2
    put session_start() ;

    on top of the page after <?php

    that should do if i understood ur problem correctly :)

    Comment

    Working...