SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Website not displaying products after migration

    Hi

    We moved a site that was developed by outsource company from old to new server and seem to be experiencing some issues on the new server. The products donít show up anymore and no changes have been done on the code. When I turn errors on like http://mlungisi-001-site1.smarterasp.net/products.php there are some notices but surprisingly it worked on the old server.

    Windows 2008, IIS7 Server

    Errors turned on

    Notice: A session had already been started - ignoring session_start() in H:\root\home\mlungisi-001\www\site1\libs\products.php on line 27
    Code:
    session_start();
    Notice: Undefined variable: iAUID in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 73
    Code:
    GetAU($iAUID, $AUID, $Email, $Firstname, $Surname, $COID, $CellNo, $PWord, $Active_Tag);
    Notice: Undefined offset: 0 in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 74
    Code:
    GetAU($iAUID, $AUID, $Email, $Firstname, $Surname, $COID, $CellNo, $PWord, $Active_Tag);
    Notice: Undefined offset: 0 in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 75
    Code:
    $_SESSION['uSurName'] = $Surname[0];
    Notice: Undefined index: uUserTypeID in H:\root\home\mlungisi-001\www\site1\libs\products.php on line 1244
    Code:
    if ($_SESSION['uUserTypeID'] == 2)
    I have tried to kill sessions before starting a new one but that didnít help either. I am caught between a latch and a door, donít know whether its code issue or PHP configurations or MySQOL. Please share ideas

    Products.php
    products.zip
    Users.php
    products.zip

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,127
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mlungisi View Post
    Notice: A session had already been started - ignoring session_start() in H:\root\home\mlungisi-001\www\site1\libs\products.php on line 27
    Code:
    session_start();
    Remove ALL whitespace above your opening <?php tag. <?php needs to be the first line and YOU can't call echo/print or any other related output methods before session_start() is called.

    Quote Originally Posted by mlungisi View Post
    Notice: Undefined variable: iAUID in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 73
    Code:
    GetAU($iAUID, $AUID, $Email, $Firstname, $Surname, $COID, $CellNo, $PWord, $Active_Tag);
    It is hard for me to tell what $iAUID is supposed to be... is it supposed to be the value of $_SESSION['uAUID']? If so, the following should resolve this one:
    PHP Code:
    $AUID ''$Email ''$Firstname ''$Surname ''$COID ''$CellNo ''$PWord ''$Active_Tag '';
            
    GetAU($_SESSION['uAUID'], $AUID$Email$Firstname$Surname$COID$CellNo$PWord$Active_Tag); 
    Quote Originally Posted by mlungisi View Post
    Notice: Undefined offset: 0 in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 74
    Code:
    GetAU($iAUID, $AUID, $Email, $Firstname, $Surname, $COID, $CellNo, $PWord, $Active_Tag);
    I think you copied the wrong line here and meant to copy
    PHP Code:
    $_SESSION['uFirstName'] = $Firstname[0]; 
    That indicates you are not getting a value back when calling GetAU for $Firstname, so it is empty. That is because your $iAUID is not correct so it can't find the user.

    Granted this is still a valid concern, to remove the notice all together, check the sizeof the array before accessing it.
    PHP Code:
    $_SESSION['uFirstName'] = (sizeof($Firstname) > 0) ? $Firstname[0] : ''
    Quote Originally Posted by mlungisi View Post
    Notice: Undefined offset: 0 in H:\root\home\mlungisi-001\www\site1\libs\users.php on line 75
    Code:
    $_SESSION['uSurName'] = $Surname[0];
    That indicates you are not getting a value back when calling GetAU for $Surname, so it is empty. That is because your $iAUID is not correct so it can't find the user.

    Granted this is still a valid concern, to remove the notice all together, check the sizeof the array before accessing it.
    PHP Code:
    $_SESSION['uSurName'] = (sizeof($Surname) > 0) ? $Surname[0] : ''
    Quote Originally Posted by mlungisi View Post
    Notice: Undefined index: uUserTypeID in H:\root\home\mlungisi-001\www\site1\libs\products.php on line 1244
    Code:
    if ($_SESSION['uUserTypeID'] == 2)
    $_SESSION['uUserTypeID'] isn't set yet. Use isset first
    PHP Code:
    if (isset($_SESSION['uUserTypeID']) && $_SESSION['uUserTypeID'] == 2

  3. #3
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks cparadio,

    Im going to look into your suggestions or opt for a completely new site

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,127
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    I'd lean toward the latter for purely one reason. I know there are more issues in those two files than what I simply stated, apart from that, there are likely "bigger" issues in other files on your site. I'm not sure who you hired and who developed it for you, but PHP wasn't their strongest language at the time.

    Whatever decision you make, I wish you the best of luck in getting what you need so your site is functional again.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •