Jump to content

ktroztafy

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ktroztafy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok here's is the EXACT code I am trouble shooting <? // Here we connect to the database $database = mysql_connect("****","*****","******"); if (!$database) die ("could not connect"); mysql_select_db("*******") or die ("MYSQL DID NOT FIND A CONNECTION:". mysql_error()); //here is the code which is not working as expected in IE if (empty($_GET["variable"])){ $update = mysql_query("UPDATE database set field='variable is empty' where id='1' "); echo "DATABASE WAS UPDATED"; } ?> <!DOCTYPE HTML><html lang="en" > <head><meta charset="utf-8"> <title>TEST</title> <style> #somediv {filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''); } </style> </head> <body> <div id="somediv"> </div> </body> </html>
  2. That's what I thought, but lets say I add an echo statement, just to keep it simple like the following... if (empty($_GET["variable"])){ $update = mysql_query("UPDATE database set field='variable is empty' where id='1' "); echo "DATABASE WAS UPDATE"; } The echo statement works as expected in EVERY browser, including IE. But that MySQL line does not. The MYSQL still updates, even if the $_GET[] is empty or not. That's just weird to me.
  3. Try : preg_replace('/( )+/', ' ', $username); to remove all white-space, then use your own code to check the $username
  4. Just to make things clear.. here's an example of the code... if (empty($_GET["variable"])){ $update = mysql_query("UPDATE database set field='variable is empty' where id='1' "); } // then all the html header stuff gets outputed by PHP including a linked rel CSS file wich contains the next line #somediv {filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''); } // then the BODY and HTML stuff is included... which should have no effect on the PHP, but also including a div with the id=somediv ... and thats pretty much it in every browser, if the $_GET variable is empty the database is updated, in IE, no matter what the database gets updated.... when i remove the line of code from the CSS, that php code works as expected... how that CSS line of code affects my MYSQL database code is beyond me... but it's happening
  5. Hello everyone, I'm new here first post, but there's a weirdness in code that i need to share, First of all, I know everyone who knows PHP/MYSQL will say the same thing... Server side code cannot be broken by a browser, especially by client side coding. I agree!!! That may be the case here too, but I have encountered one of the weirdest code ever and the client side code is causing an unexpected result in PHP/MYSQL, and only in Internet Explorer. Unexplainable, and I am seeking for an answer. After hours of trouble shooting I finally targeted the the trouble code... and it's CSS, and it's affecting a MYSQL line of code in PHP... #somediv { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''); } ... anyways let me explain how the code should run and the problem... in one page a variable passed in the URL is being captured by PHP using the $_GET method, if that variable is empty PHP runs a code which updates a MYSQL database. That works fine, and as expected, except in INTERNET EXPLORER. On that same page, a css file which is to be included with the output html to the browser contains the above line of css too. Now in every other browser that code works as expected, if the variable is NOT empty, update the database and then output the html code. In IE the database gets updated no matter what, whether the variable is empty of not. Now the its only the mysql code inside the IF statement that get affected, because for troubleshooting purposes I have put echo statements inside the code, to catch the problem, and the echo statements work as should, just not the mysql update statement. Someone care to shed some light into this mystery?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.