Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
开发者_开发知识库 Improve this questionI want to know how I can show a image in a specific point - for example (55,125)
- in php?
Also, how can I get scene resolution in php?
Do it Javascript, PHP is on the server and the screen is on the client. You may use ajax, create a DIV at the point where you want the image and then populate the same using Ajax call to your php script. Refer here to know how to get screen details using javascript.
Alternatively, you can:
echo "<div style=\"position styling goes here\"><img (its attrib) /></div>";
Though some would consider this as not a good approach.
PHP runs only on the server, which sits in your server farm.
The browser, which renders what comes from the server into something visible, does it's stuff on the clients computer, i.e. the home computer people use to surf with the web.
So, what runs on the computer at home is Javascript, HTML, CSS FLASH etc.
You will need to play with those to change the place an image is on the screen, it has nothing to do with PHP.
In CSS you can give absolute placement to an image:
css:
#my_image{
display: block;
position: absolute;
top: 55px;
left: 125px;
}
html:
...
...
<img src='my src' id='my_image' />
精彩评论