Jump to content

Javascript help for firefox


xam

Recommended Posts

Hello everyone,

I need help to fix my firefox problem with my below code..

This is my tracklink.html file
[code]<script type="text/javascript">
function logClick() {
    window.focus();
    bug = new Image();  
    bug.src = 'http://mywebsite.com/track.php?pg=' + escape(document.title);
}
</script>
<iframe src='showads.html' frameborder='0' width='300' height='50' onFocus='logClick()'></iframe>
[/code]

This is my track.php file
[code]
<?
mysql_connect("localhost", "root", "mypass") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("stats") or die(mysql_error());
echo "Connected to Database<br />";
$ip = $_SERVER['REMOTE_ADDR'];
$page = $_GET['pg'];
mysql_query("INSERT INTO stats (page, ip) VALUES ('$page', '$ip')") or die(mysql_error());
mysql_close();
?>[/code]

When someone click a link on the tracklink.html page, it should send pagename and visitorip to track.php and track.php should send this results to my database..

Everything is work with Internet Explorer, But mozilla cant sent results to track.php..

I tested it with direct link with mozilla e.g.: [code]http://mywebsite.com/track.php?pg=test[/code] It work.. Its %100 javascript error.... I need more stable javascript code to track clicked links..

My regards.
Link to comment
https://forums.phpfreaks.com/topic/5853-javascript-help-for-firefox/
Share on other sites

[!--quoteo(post=358706:date=Mar 27 2006, 12:54 AM:name=xam)--][div class=\'quotetop\']QUOTE(xam @ Mar 27 2006, 12:54 AM) [snapback]358706[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Where ?
[/quote]

??

anyway, open your Javascript Console in FF (tools menu). you may need to clear it as some ads on some sites fill it full of rubbish...try out your site....what errors/warnings come up in the JS Console?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.