Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3662242
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:23:41+00:00 2026-05-19T01:23:41+00:00

I was wondering if someone can help me, I have the following script that

  • 0

I was wondering if someone can help me, I have the following script that redirect users to an affiliate link when they click on a banner.

<?php
$targets = array(
'site1' => 'http://www.site1.com/',
'site2' => 'http://www.site2.com/',
'site3' => 'http://www.site3.com/',
'site4' => 'http://www.site4.com/', );
if (isset($targets[$_GET['id']])) {
header('Location: '.$targets[$_GET['id']]);
exit; } 
 ?>

Is it possible to track when a user hits the banner telling me the referer site as well as the ip address of the person clicking on the banner.

hmmmm something like pixel tracking?

I have tried to add an iframe that does the tracking but it creates an error

Hope it makes sense

Thanks!

This is more or less how I would have done it in asp

   <%

    var Command1 = Server.CreateObject ("ADODB.Command");
    Command1.ActiveConnection = MM_cs_stats_STRING;
    Command1.CommandText = "INSERT INTO stats.g_stats (g_stats_ip, g_stats_referer)  VALUES (?, ? ) ";
    Command1.Parameters.Append(Command1.CreateParameter("varg_stats_ip", 200, 1, 20, (String(Request.ServerVariables("REMOTE_ADDR")) != "undefined" && String(Request.ServerVariables("REMOTE_ADDR")) != "") ? String(Request.ServerVariables("REMOTE_ADDR")) : String(Command1__varg_stats_ip)));
    Command1.Parameters.Append(Command1.CreateParameter("varg_stats_referer", 200, 1, 255, (String(Request.ServerVariables("HTTP_REFERER")) != "undefined" && String(Request.ServerVariables("HTTP_REFERER")) != "") ? String(Request.ServerVariables("HTTP_REFERER")) : String(Command1__varg_stats_referer)));
    Command1.CommandType = 1;
    Command1.CommandTimeout = 0;
    Command1.Prepared = true;
    Command1.Execute();

    %>

I am not sure how to do it in php – unfortunately for me the hosting is only supporting php

so I am more or less clueless on how to do it in php

I was thinking if I can somehow call a picture I can do it with pixel tracking in anoter asp page, on another server.

Hope this makes better sense

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:23:42+00:00Added an answer on May 19, 2026 at 1:23 am

    If you want to track ip and referrer using PHP, then use SimpleCoder’s advice.

    If you want to track ip and referer using some 3rd party javascript tracking code (like Google Analytics or whatever), you can create a “landing” page with a “Refresh” header. Something like

    ...
    <meta http-equiv="Refresh" content="0;url=<?php echo $targets[$_GET['id']]?>" />
    </head>
    ...
    <script src="some-tracking-code.js"></script>
    ...
    

    Browser will first load this page, javascripts will execute, and then it will redirect to url specified in the header

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if someone can help me understand the following behaviour. If I have
I was wondering if someone can help me out with this issue. I have
I don't have formal knowledge of continuations, and am wondering if someone can help
I'm wondering if someone can help me out. I have a form_dropdown which I'm
I'm wondering if someone can help me with this. I have three TabPanels depending
I have a small problem and wondering if someone can help me out. I'm
I was wondering if someone can help me with this.. I have about 500,000
I'm wondering if someone can help me to understand the following command. The purpose
Just wondering if someone can help me out with this quickly. I have a
Just wondering if someone can help me with the following issue. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.