Controller called twice |
[eluser]emorling[/eluser]
My controller get's called twice. This is the controller function I run. Code: function dosell($char_id, $item_id){ And this is the DEBUG LOG: Quote:DEBUG - 2009-09-17 19:43:38 --> Config Class Initialized See the bolded items above. This confirms that the controller is run twice. I ran Fiddler with Firefox and it does not make two browser requests. Any ideas?
[eluser]OverZealous[/eluser]
Try putting this in your function: Code: $debug = debug_backtrace(); It's a bit of stacktrace-like code that will help you figure out what called the current PHP function.
[eluser]emorling[/eluser]
Quote:STACK TRACE: I get this. Can we draw any conclusion?
[eluser]OverZealous[/eluser]
That's it? Then it's like I said, you are most likely getting two complete calls from the client, or at the server level. Those are the normal startup methods for a CodeIgniter controller. If you were getting some kind of internal calling, you'd see a much longer stacktrace. (You might want to throw it at the end of the method, to see if it is different.) Play around with it some more. You have all of the sources to CodeIgniter, so you can usually follow the function threads as you work. If I remember correctly, the "line number" doesn't always match up with the file name. You might have to be creative ;-)
[eluser]emorling[/eluser]
Thanks will do. I just don't understand why it only happens when I leave the $item-delete method in. When I take it out it works fine. Even if I run this it runs twice: $it = new Item(); $sql = "DELETE FROM `items` WHERE `id` = ".$item->id; $it->query($sql);
[eluser]OverZealous[/eluser]
I think it's running twice no matter what, you just only see it after you delete the item, because you are dieing. That might be your problem, as well. Don't use die unless it's a serious server-side error. You are sending information back to the browser that something went wrong when you use that. Just return from your method, instead, or use CodeIgniter's show_error().
[eluser]emorling[/eluser]
Ugh.... you are not going to believe this... I checked my ci_sessions table and there was an unknown IP adress in there, which is impossible because this is on a very obscure adress. Somehow a call was made from an IP in ANOTHER country with Mozilla to each page I visit. That is why two calls were made, but I could not detect them with Fiddler. I added the IP to the banned list of my site, and it fixed it. Any security experts here? Is this some kind of trojan behavior?
[eluser]OverZealous[/eluser]
Yuck. Sounds like a virus/trojan/keylogger situation. Are you using Windows? If so, you might have the AntiVirus Pro (goes by many other names) virus. My parents just got hit by it (it's incredibly sneaky), and it's a PITA rootkit that (amazingly) can be removed. However, it took me a whole weekend of remote support to get their computer cleaned. One possible link. Good luck!
[eluser]emorling[/eluser]
Thanks will try. Im now running an online Trojan scanner.
[eluser]emorling[/eluser]
Thanks, I used the Malware Removal software and found a trojan. Hopefully that solves it. |
Welcome Guest, Not a member yet? Register Sign In |