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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:56:52+00:00 2026-06-11T23:56:52+00:00

One thing I have never used PHP for is on-demand image placement – but

  • 0

One thing I have never used PHP for is on-demand image placement – but now that problem has come up for me…

I need a function which will, given some X and Y coordinates, place a .png, or .gif somewhere on screen, using some form of absolute positioning.

I’m afraid I have absolutely no idea where to start looking for such information. For me, PHP is about displaying data from databases. This is an utterly alien concept to me! 🙂

  • 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-11T23:56:53+00:00Added an answer on June 11, 2026 at 11:56 pm

    maybe this example helps you to get started.
    I used HTML, CSS and PHP

    <?php 
    /*
     * here you can define your coordinates in pixel
     */
    $myXCoordinate = '100px';
    $myYCoordinate = '200px';
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Your Page title</title>
      <style type="text/css">
      .absolute-pos {
        position: absolute;
        width: 160px;  /* here you could set a fixed pixel size, e.g. 200px */
        height: 160px; /* here you could set a fixed pixel size, e.g. 200px */
        left: <?php echo $myXCoordinate; ?>;
        top: <?php echo $myYCoordinate; ?>;
      }
      </style>
    
    </head>
    <body>
      <p>showing the logo of wikipedia [source: upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png]</p>
      <img class="absolute-pos" src="http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png" alt="Some description." />
    </body>
    </html>
    

    Copy this code and save it to a php-file, e.g. “index.php”. Then change the values for $myXCoordinate and $myYCoordinate. This will change the absolute position of your image.

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

Sidebar

Related Questions

I have been using jQuery lately, but never used JSON with it. Now, I
I have never used CRON or anything like that, rails etc.. before, but I
I have been designing websites for a while now, but there is one thing
I'm pretty good with PHP, but the one thing I've never understood completely is
I am using below URL to show line chart but one thing I have
We have a number of servers running various different LAMP setups. One thing that
I have a cool snippet of code that works well, except one thing. The
I have some python and numpy experience but have never used R before. I'm
I have written a PHP application and have a problem that I cannot solve
I have used XDebug semi-sucessfully with PhpStorm and Mamp, but now 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.