Re: [PHP] Function returning but continues execution

2007-01-23 Thread David Mytton
Jochem Maas wrote: rewrite 'section/addfriend/will' -> 'index.php?cmd=section/addfriend&username=will' rewrite 'section/addfriend/templates/js/jquery.js' -> 'index.php?cmd=section/addfriend&username=templates/js/jquery.js' and what's the bet that this second rewritten url is the bogey man her

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: Can I see the rewrite log for a single request now? Please make sure it's only one request. http://paste.lisp.org/display/35791 David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: append [L,NS] to all RewriteRules Done that, but the problem is still there - doesn't seem to have made any difference. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: Bzzzt, I'm an idiot. It doesn't, of course. You're still missing [L] and that's what I was trying to point you at until the cat ran over my keyboard... Alright. So if the rewrite rules were (and they are): RewriteRule ^section/account(/)?$ index.php?cmd=section/account

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: Ok, what does RewriteLog contain for one such request? RewriteLogLevel 9. http://paste.lisp.org/display/35779 David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Roman Neuhauser wrote: Can we see your mod_rewrite configuration? RewriteCond, RewriteRule, all that jazz. There are a number of rules but the only one that is relevant for this page is: RewriteRule ^section/addfriend(/)?(.*)$ index.php?cmd=section/addfriend&username=$2 David -- PHP Gene

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
At the very bottom of your function place another return with a string like return 'FOUND THE END OF FUNCTION'; now, echo the return of the function and see if it really the return function that you think it is that is returning false, or you are just hitting the end of the function. Jim

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
I added this in and it outputs 1 as I suspected - the function is being called only once. David Robert Cummings wrote: On Mon, 2007-01-22 at 16:36 +, David Mytton wrote: Yes, I know it looks like a bug in my code because I'm not able to write a test case that can reproduce it s

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
Yes, I know it looks like a bug in my code because I'm not able to write a test case that can reproduce it simply enough to report as a bug - hence why I am posting here. However, the behaviour I am describing surely suggests some kind of issue somewhere in PHP itself. My reasoning for this is

Re: [PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
I can't see how there is a bug in my code if when I echo the contents of the 2 variables, they are exactly the same as when I set them manually. Except in the former the function "continues executing" but in the latter it doesn't. I also cannot see how the function can return false and execute

[PHP] Function returning but continues execution

2007-01-22 Thread David Mytton
hpmailer return true; On my Linux server, the function returns false at step #4 as it should do, but it appears to continue executing. The friend count is incremented and the page execution slows temporarily whilst the mail is being sent (not a problem in testing). However, no e-mail actually gets sent. The key is that the function is returning false but it continues to execute! If I stick in an exit; after the in_array() check at point #4, this doesn't happen. There are no other places where this function is called, and it is only called once. Strangely, if I force the values of the 2 variables before the in_array() check: $_SESSION['user']['friends'] = array(0 => 3); $friend['user_id'] = 3; it reacts as expected - the function returns false and no further code is executed. Anyone have any suggestions? Regards, David Mytton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php