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 8154417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:20:31+00:00 2026-06-06T16:20:31+00:00

I am currently messing around with some code for an advertising network, i have

  • 0

I am currently messing around with some code for an advertising network, i have the main PHP back end complete but am struggling with the actual serving of the advert/image/swf.

I have tried using document.write, but this seems to get rid of the whole body, which is expected. However, looking at other ad networks code, it seems some use this to.

I have tried creating an element;

 var element = document.createElement('div');

 element.innerHTML = '<a href="'+url+'"><img src="'+path+'"></a>';

Does anyone have any idea how i can write the advert into the page, where the ad code was placed?

Thanks!

  • 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-06T16:20:33+00:00Added an answer on June 6, 2026 at 4:20 pm

    This is how I do it currently and it works just fine:

    This is the code I offer to users to put on their websites

    <script type="text/javascript" src="http://yoursite.com/serve.php"></script>
    

    And in serve.php I just simply echo the ad image I want wrapped in an <a> tag

    document.write('<a href="<?php echo $redirect_url ?>" target="blank"><img src="<?php echo $imageFile ?>" border="0" /></a>');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently messing around with some stuff for an idea for a site
am currently messing around with DialogFragment to learn to use it. I assumed that
I am currently messing around with DialogFragment to learn to use it. I assumed
I'm currently messing around with Rob Eisenberg's Caliburn framework. When looking at the documentation
I am currently using this code to grab key-strokes, but I am missing e.g.
I am currently playing around with ARC a bit to get some things figured
Okay, I have been messing around with different sorting algorithms in Ruby; mainly variations
I've inherited a large amount of Classic ASP code that is currently missing SQL
I am currently working on some personal tests and benchmarks to compare the workflow
In the code below I'm trying to take some text and wrap a html

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.