TinyPortal

Development => Support => Topic started by: Mahtan on April 18, 2006, 06:11:46 PM

Title: Verrrry strange (MySQL connection in an article with IE?)
Post by: Mahtan on April 18, 2006, 06:11:46 PM
Hey guys,

This has been bugging me for a while now, and I can't seem to find the problem.  If I had to guess, I would say it probably has something to do with headers, but I'm not sure.

Here's the situation:
I made a PHP article in TinyPortal.  The PHP has only one line of code - an include statement, which includes a PHP file on my site.
The problem is - everything seems to work fine in FireFox, but in InternetExplorer, when I load up the article page, strange things occur.  Sometimes the page will just be the background color, sometimes it seems that the page just "stops" (like the code just cuts off, randomly, as if the server stopped transmitting), sometimes the page will load and then either the article or the whole page will dissapear (as if via javascript), and other such oddities.

In the inlcuded .php file, I need to access a MySQL database, but NOT the same database that is used by SMF/TP.  To avoid confusion, I created a 2nd database connection (using mysql_connect and so on) and when I do my queries, I explicitly use MY connection, and close the connection at the end of the PHP file.
All fine and dandy - the odd part is, removing the mysql connect/select db/close code appears to fix the aforementioned IE problem.  I could be wrong, but that is how it seems.

Here is the page in question:
http://www.zepphire.com/index.php?page=12
You can see where my database connection is used in the "Shard:" dropdown (all data except the first option is populated from a database).
If the page loads properly, try clicking "Search" a few times in InternetExplorer.    It will probably do something "funky" pretty quickly.  If you "view source" during this time, it will probably show the source code just randomly terminating (like ih the middle of javascript).







I'm completely stumped.  The only logical conclusion I can seem to draw is that the mysql connection I am creating somehow changes the headers(?) or something and causes IE to not properly recieve all the data, or randomly drop in and out, or something of that nature.  Any ideas?

Thanks a ton in advance,
Mahtan
Title: Re: Verrrry strange (MySQL connection in an article with IE?)
Post by: feline on April 19, 2006, 10:10:25 AM
inside your data is one or more single-quote. this must by masked befor output !

example:
Fehler: missing ) after argument list
Quelldatei: http://www.zepphire.com/index.php?page=12
Zeile: 1, Spalte: 67
Quelltext:
highlightRow('Item_1','#B7C5D2');return overlib('<b><center>Daimyo's Helm</center></b><CENTER><b>insured</b><BR>Weight: 6 Stones<BR>Price: 300000<BR>Self Repair 3<BR>Swing Speed Increase 10%<BR>Physical Resist 6%<BR>Fire Resist 2%<BR>Cold Resist 10%<BR>Po


you see that, if you look at the javacript console on Firefox ..

Fel
Title: Re: Verrrry strange (MySQL connection in an article with IE?)
Post by: Mahtan on April 19, 2006, 08:47:44 PM
Good catch, I went ahead and fixed that, but it still has nothing to do with the problem at hand (the IE problem)...
Title: Re: Verrrry strange (MySQL connection in an article with IE?)
Post by: feline on April 19, 2006, 09:12:50 PM
I can see the site in IE .. but many error what I say
I'm using W2K and IE 6.0.28

Fel
Title: Re: Verrrry strange (MySQL connection in an article with IE?)
Post by: Mahtan on April 20, 2006, 01:39:16 AM
Ignore the search part for the moment - that's not in question (the errors are coming from a seperate included page).  The page after you press "Search" differs from the one before you press "Search", and we're not even looking at the post-search code yet.  I just want the pre-search code to work.

Interestingly, the problem doesn't appear if you "Refresh" the page.  Try clicking the "Search UOMM!" link in the navigation panel on the left a few times, though, and the error should occur.
Here's an image of the page in IE + source code in notepad to illustrate my point.  All the red text has been added by me (yay MSPaint).
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.zepphire.com%2Fpersonal%2Ftperror.GIF&hash=75a9ef868522272772ee1ad09cfcf590abb7ca6d)

See the problem?
Title: Re: Verrrry strange (MySQL connection in an article with IE?)
Post by: Mahtan on April 20, 2006, 02:37:26 AM
I finally managed to fix the problem by turning on the "Persistent MySQL Connection" in SMF's settings.  Thanks for the help.