Quick Authentication

Posted by Brian Moon 
noe
Re: Quick Authentication
September 12, 2005 12:33PM
Hi there!

Like Portal of Curiousity, i receive the same error message when using this script:

Warning: Invalid argument supplied for foreach() ...
foreach($USER["user_data"] as $key=>$data){

Any idea why this error occurs?


By the way - when changing the foreach loop into a while loop, all works perfectly for me.

thanks
Re: Quick Authentication
September 12, 2005 12:45PM
Then you're possibly using a PHP optimizer which does not match your current PHP version.
noe
Re: Quick Authentication
September 12, 2005 12:50PM
mmakaay Wrote:
-------------------------------------------------------
> Then you're possibly using a PHP optimizer which
> does not match your current PHP version.


hmm nope, not that i know....


Re: Quick Authentication
September 12, 2005 01:01PM
Are you using the most recent version of the script? That was a problem a long while ago, but fixed for some time.

noe Wrote:
-------------------------------------------------------
> Hi there!
>
> Like Portal of Curiousity, i receive the same
> error message when using this script:
>
> Warning: Invalid argument supplied for foreach()
> ...
> foreach($USER["user_data"] as $key=>$data){
>
> Any idea why this error occurs?
>
>
> By the way - when changing the foreach loop into a
> while loop, all works perfectly for me.
>
> thanks




Brian - Personal Blog
noe
Re: Quick Authentication
September 12, 2005 01:12PM
brianlmoon Wrote:
-------------------------------------------------------
> Are you using the most recent version of the
> script? That was a problem a long while ago, but
> fixed for some time.

Yes, it is the latest version.

I have really no idea why this error occurs :\
- But would there be any negative effect when i use the while loop instead of the foreach loop? (because, as mentioned, using the while loop seems to work for me)
Re: Quick Authentication
September 12, 2005 01:17PM
what kind of while loop?

Brian - Personal Blog
noe
Re: Quick Authentication
September 12, 2005 01:35PM
brianlmoon Wrote:
-------------------------------------------------------
> what kind of while loop?
>
> Brian.
> Phorum Hacker
> [phorum.org]


ups sorry - I just noticed that my while loop is nonsense - it does exactly nothing. (Deleting the foreach loop would have produced the same effect)

So to summarize - Using the original script works, but I still get the foreach() Error message.

*hmmm*
noe
Re: Quick Authentication
September 12, 2005 02:49PM
ok - i got the solution for my problem.

The problem was, that i had not specified any user_data (in the user profil) for these user-test-accounts, so the array was not filled up with data and put out this error message;

But if this is the reason, it seems that the script is a little bit buggy - Im quite sure that not every registered user is going to fill his additional user fields(?)

bw,
noe
Re: Quick Authentication
September 12, 2005 03:07PM
yeah, I guess it should check that. Odd that there is no data in there at all though.

Brian - Personal Blog
noe
Re: Quick Authentication
September 12, 2005 03:34PM
brianlmoon Wrote:
-------------------------------------------------------
> Odd that there is no data in there at all though.

Hmmm - Should the user_data field normally be filled with something, even though the user does not configure/insert anything? (neither a real name, nor a signature ...?)
Sorry, only registered users may post in this forum.

Click here to login