Results 1 to 4 of 4

Thread: Help with placing ads inside an image

  1. #1
    Join Date
    May 2010
    Posts
    18
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Help with placing ads inside an image

    Hi guys,

    Could someone please tell me how I can place an ad inside an image?

    Something similar to this: http://berrycorp.biz/freelance.php
    Please wait a few secs for th epage to load so you can see the function (ads inside images) that I am looking for.

    any help will be much appreacited.

    Thank You
    Kind Regards

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Why is this a question for PHP? This should be possible using CSS.

    I don't understand exactly what you want-- just place one image over another image? That's using z-index and position:absolute (probably).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    May 2010
    Posts
    18
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    No, I don't need place an image in another image. that is easy done using AP DIVS.

    I need a PHP code to be able to place within the current codes in the page and the code will automatically detect images and place ads on within the image simialr to the one that I showed above.

    I put it PHP section because I thought this could be done using PHP. If you have any other suggestions then I'd love to hear that mate...

    Thank You
    Kind Regards

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ah, I think I understand now.

    But would this be a lot easier manually?

    How will you determine which images to use? Just every image on the page? What about small images that won't fit the ad?


    Anyway, you can approach this two ways:

    1. Server side language (like PHP): read the entire page as HTML into an array. This means using an output buffer or some form of advanced templating. After you read it into HTML as some sort of object (array, class, etc) you can loop through each element and find which ones are 'img'-- then just add a new 'img' tag next to that.

    2. Use Javascript. There are some disadvantages here, mostly that your visitors will need JS enabled. However, this is MUCH easier than doing it with PHP, because Javascript can work with the active page and not need to add an extra step in the process. This also is nice because Javascript already sees the page as elements so you don't need to parse it, but just loop through them.


    Doing this with Javascript may be reasonable, but I really don't think there's much point of using PHP. It's more effort than it's worth, probably.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •