Jump to content

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?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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