Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2012, 10:00 PM   PM User | #16
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,046
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
The missing thing right from the beginning post was the fact that both
'if' statements needed to be comparing to $loginsession...

So, the long way, but easier to see ... and troubleshoot
PHP Code:

$flag
=0;

if(
$fetch_escrow->invited == $loginsession){  
   if(
$fetch_escrow->invitedlevel ){  
   
$flag=1;  
   }
}
if(
$fetch_escrow->username == $loginsession){  
   if(
$fetch_escrow->usernamelevel ){  
   
$flag=1;
   }
}  

if(
$flag==1){
echo 
"Display Finalize Button";


Shortened way ... harder to see:
PHP Code:

if ((($fetch_escrow->invited == $loginsession) && ($fetch_escrow->invitedlevel 1)) || (($fetch_escrow->username== $loginsession) && ($fetch_escrow->usernamelevel 1))) {
// display finalize button

mlseim is offline   Reply With Quote
Users who have thanked mlseim for this post:
Dan13071992 (11-29-2012)
Old 11-29-2012, 10:30 PM   PM User | #17
Dan13071992
Regular Coder

 
Join Date: Dec 2010
Location: Kent, UK
Posts: 573
Thanks: 23
Thanked 10 Times in 10 Posts
Dan13071992 is an unknown quantity at this point
thats it that works like a charm thank you for that, and sorry about all the confusion lol.

once again, thanks for the help, your an absolute star, its been playing on my mind for so long, and it is in fact, so simple lol, i cant believe i didnt think of it.
__________________
http://360-tactics.co.uk/forum/index.php

Crime-Wave

please post your code wrapped in tags
please post your PHP wrapped in tags
Dan13071992 is offline   Reply With Quote
Old 11-29-2012, 10:39 PM   PM User | #18
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,046
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
It took us a long time to get there. But you learned something new hopefully.

I really hope you learned to expand things out, and insert some scripting to help
troubleshoot what was happening. Talking outloud (on paper) helped to find
that part we were missing.


.
mlseim is offline   Reply With Quote
Old 11-29-2012, 10:44 PM   PM User | #19
Dan13071992
Regular Coder

 
Join Date: Dec 2010
Location: Kent, UK
Posts: 573
Thanks: 23
Thanked 10 Times in 10 Posts
Dan13071992 is an unknown quantity at this point
i sure did thank you, and thank you for being a good teacher on more than one occasion
__________________
http://360-tactics.co.uk/forum/index.php

Crime-Wave

please post your code wrapped in tags
please post your PHP wrapped in tags
Dan13071992 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:21 AM.


Advertisement
Log in to turn off these ads.