SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Obsessive designer Infizi's Avatar
    Join Date
    May 2004
    Location
    North Pole
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy why wont a simple if work?

    ok, script

    if(($pot['id'] == $post['id']) && ($post['name'] == $ur_dt['uid'])){
    $editadminlinks = "blahblahblah".$editadminlinks;
    }

    (that if also has to be inserted into another if like this

    if(($user->auth == 1 AND $user->admin ==1 || $user->admin==2) OR (($pot['id'] == $post['id']) AND ($post['name'] == $ur_dt['uid']))){

    )

    Right.

    These are in a loop, ard check to see if a)your admin, so it adds a link to each post, and b) if you posted it so you can edit it.

    i did an echo (echo $pot['id']." ".$post['id']." ".$post['name']." ".$ur_dt['uid'] and i got these values 77 72 1 177 73 1 177 74 1 177 75 1 177 76 1 177 77 1 1 (note the last 4, 77 = 77, 1 = 1 so the stament should work the last time)

    But it dosent work. I dont know why. is all it does is if i log in as admin the statment ($user->auth == 1 AND $user->admin ==1 || $user->admin==2) becomes tru, and shows one link. But it wont shoe the edit link!!!!

    So, basically, what is wrong with thses lines

    if(($pot['id'] == $post['id']) && ($post['name'] == $ur_dt['uid'])){
    $editadminlinks = "blahblahblah".$editadminlinks;
    }

    any ideas at all?

  2. #2
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's hard to understand what's not working. Can you simplify your example.

  3. #3
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Also please read this first


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
  •