what's wrong with the first list item? why is the form showing up for the second one but not the first? I would think that since the <input> element in the first video appears that means the first if(isset($_COOKIE['goodact']) && $u_logged!=$post['username']) has passed. But since the <form> element didn't render in the first one, that would mean that initial condition didn't pass right? the code seems to be contradicting itself here... so confused

02-19-2014, 04:51 AM

BezzzZ

interesting, can you post the full code ?

02-20-2014, 10:37 AM

thewebiphyer

before I do... is the code I have posted not providing sufficient details to find the solution? I get very protective of my code so I don't like posting more than is absolutely necessary

02-20-2014, 03:46 PM

NogDog

What are you actually looping on?

Best guess would be that $post['username'] is not the same on each iteration, but there's no way to be sure without seeing the source of those values and whether anything else in the code is messing with them. You could add some error_log() or other debug code to see what's in $post right before that check, as well as any other variables of interest.

02-24-2014, 01:29 AM

BezzzZ

because the issue may be elswhere, I can't see why it would be doing anything in this code you have posted

02-24-2014, 07:09 PM

thewebiphyer

sorry it took me so long to respond... I will be looking at what you said nogdog... I have a lot of projects going.. I'll let you know what i find

03-03-2014, 12:57 PM

thewebiphyer

Quote:

Originally Posted by NogDog

What are you actually looping on?

Best guess would be that $post['username'] is not the same on each iteration, but there's no way to be sure without seeing the source of those values and whether anything else in the code is messing with them. You could add some error_log() or other debug code to see what's in $post right before that check, as well as any other variables of interest.

I am iterating on a multidimensional array which contains information about users posts.

I took at look at $post['username']... I'm not sure if the problem I'm having lies in the $u_logged!=$post['username'] condition or elsewhere... I echoed out both variables on each iteration of that type and each time it ends up being true. So I'm still confused about why the <form> element isn't rendering while the <input> element is.

anyways... here's the whole thing I'm talking about... this is the loop

really? noone? I also found out that my problem only happens when certain users are logged in... REALLY confusing

03-08-2014, 01:01 PM

thewebiphyer

well okay then if no one is going to respond then forget it... I'll just unsubscribe from this i guess

03-08-2014, 02:36 PM

Error404

From what I can tell, some of your code is redundant, although it's unlikely to be the source of the problem. For example, in vid.php and articl.php, you have 2 if(isset($u_logged)) one after the other. If lots of your code is like this, it'll be harder for you to read and may be a possible source for a problem.

In terms of only having certain users experiencing difficulty, I would look at how you're storing the username and passing it across pages. Personally, I prefer sessions due to their simplicity but I don't see any session or cookie that's storing the username, perhaps it's elsewhere in your code. To see where it's no longer being retained, echo the username. If it is being retained properly, then the next step is to look at whether there is something about the problematic usernames, such as whether there's a space, other special characters, numbers, etc... . If you're processing the username in some way, then this may throw it off.

As for not wanting to post all of your code, I understand and it's very well appreciated to only post a relevant snippet.