I've been struggling with this problem for over a week now - and I finally crawl the cross and ask for help. Because I'm 100% and totally lost on this issue. On my website I use lots of forms, obviously. The thing is, around a week ago these forms started acting really weird - not just "mentally unstable"-weird, I mean weird by the core defintion of that word!
Basically, at first it seemed random when a variable would lose and not lose its content. But I have isolated a couple of incidents where certain things happen. Let's take this code as our starting point:
Code: Select all
$name = $_POST['setname'];
mysql_query("UPDATE em_database_content SET name='$name' WHERE id='$id'");Code: Select all
$name = $_POST['setname'];
$name && mysql_query("UPDATE em_database_content SET name='$name' WHERE id='$id'");Also, I could of course just do the $name && in front of all queries, but I dont want that. I want my code to work - and I want to understand WHY it works.
If I do this:
Code: Select all
$name = $_POST['setname'];
mysql_query("UPDATE em_database_content SET name='$name' WHERE id='$id'");
echo $name;Another weird thing I'm not 100% sure is related to this, is that I can execute this code:
Code: Select all
echo "--" . $_POST['setname'] . "--";WHILE in the render there is the content of the $POST variable.. How is this even possible? It shouldnt be to my understanding. This only happens in Google Chrome, in Firefox and IE it shows up correctly in the source code.
I've never seen anything like this in my 7 years of PHP programming, and I really hope someone can help me out. This is holding back the project of my life which Ive been working on for over 2 years now. And it has spread to all corners of my app :-/ I have too been thinking virus, but then again, how can I virus on the server side make the browser act weird - and how can a client side virus make the database lose information?
I also tried a complete server move and messed around with magic_gpc and register_global. Feels like I've tried everything possible several times.
I'm really lost. I'm so lost I will pay $20 for the solution (via Paypal) - if several people contribute to the actual fix the amount will be split.