TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,020
  • Total Topics: 21,332
  • Online today: 737
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 295
  • Total: 295

Verrrry strange (MySQL connection in an article with IE?)

Started by Mahtan, April 18, 2006, 06:11:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mahtan

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

feline

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

Mahtan

Good catch, I went ahead and fixed that, but it still has nothing to do with the problem at hand (the IE problem)...

feline

I can see the site in IE .. but many error what I say
I'm using W2K and IE 6.0.28

Fel

Mahtan

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).


See the problem?

Mahtan

I finally managed to fix the problem by turning on the "Persistent MySQL Connection" in SMF's settings.  Thanks for the help.

This website is proudly hosted on Crocweb Cloud Website Hosting.