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

  • SEARCH
  • Home
  • 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 9109931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:09:29+00:00 2026-06-17T03:09:29+00:00

We’re trying to create a trackback system where an outside web publisher can put

  • 0

We’re trying to create a trackback system where an outside web publisher can put some html on a page on their website that links back to a specific product page on our site. Let’s call it a ‘badge’ for purposes of this question.

Once they’ve inserted the badge, we want to identify this, then grab the < h1 > and first < p > as a teaser to comprise a link from our site back to theirs and write all this stuff to our database. Then, our users can see the title and first bit of their page, then decide if they want to see more.

Here’s what we’ve done (not much I’m afraid):

<a href="http://www.mysite.com/abc.html">
<img alt="abc" src="http://www.mysite.com/logo.gif" style="width:200px;height:100px" />       
</a>

We’re planning to build an admin page to do the last part of grabbing the < h1> and < p> and posting it to the live database, etc. and we’ll figure this out later.

However, the middle step (identifying that this piece of html has been used) we’re at a loss.

Is this something we should be doing through a log file….I have no clue even how to begin thinking about it.

A little direction of where to begin working on this problem would be very helpful.

Thanks in advance!!

  • 1 1 Answer
  • 0 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-06-17T03:09:30+00:00Added an answer on June 17, 2026 at 3:09 am

    This is one approach.

    You give them HTML which looks something like:

    <a href="http://www.mysite.com/abc.html">
        <img alt="abc" src="http://www.mysite.com/logo.php" style="width:200px;height:100px" />       
    </a>
    

    Notice that says logo.php, not logo.gif.

    logo.php will live on your server. Its purpose is twofold:

    1. Gather information about the page holding the <img> tag
    2. Load and output logo.gif so the users see the image as expected.

    If you embed that html on a webpage somewhere, logo.php will have information about where the request for the image originated. Specifically, $_SERVER['HTTP_REFERER'] will give you the complete URL to the page where the img tag resides. It is then up to you to decide how to process and store that information.

    I don’t know exactly what you want to do, but a very simplified logo.php would look something like this:

    <?php
    $url = $_SERVER['HTTP_REFERER'];
    
    // do something with $url... 
    // it will be something like "http://theirsite.com/wherever/they/pasted/the.html"
    
    // now output the logo image...
    header("Content-Type: image/gif");
    echo file_get_contents("/path/to/logo.gif");
    

    Keep in mind that every time anyone hits their page with the image tag, logo.php will be run. So don’t accidentally create 10000 links back to their site on your site 🙂

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I am trying to loop through a bunch of documents I have to put
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.