how do i change position of image in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rajdey1
Forum Newbie
Posts: 6
Joined: Wed Jan 04, 2012 5:46 am

how do i change position of image in php

Post by rajdey1 »

Hi
I am totally new to php as I come from C# and java platform but due to some reason i need to change a html page to php I am stuck how to do the following

/* OBJECT STYLES */
div.Object2224 { position:absolute; top:740px; left:691px; z-index:64;}

<div class="Object2224"><img src="files/new1.gif" alt="" width="28px" height="11px"></div>

just see the two lines which specifies the src ,left postion ,width and height what I need is to change the image position through php in other words the above two lines specifies a static position of the image but now i want it to be dynamic i.e. i need to change the left position kindly advice how to do it ...

Thanks in advance
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: how do i change position of image in php

Post by social_experiment »

Im not sure how but i would say it involves using javascript to rewrite the new values on the fly.

Hth
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
rajdey1
Forum Newbie
Posts: 6
Joined: Wed Jan 04, 2012 5:46 am

Re: how do i change position of image in php

Post by rajdey1 »

Hi
I dont want to do it in php not javascript
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: how do i change position of image in php

Post by social_experiment »

Yeah, php however cannot do things like change values without sending a request to the server, meaning you would usually have to resubmit, refresh your page.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
rajdey1
Forum Newbie
Posts: 6
Joined: Wed Jan 04, 2012 5:46 am

Re: how do i change position of image in php

Post by rajdey1 »

Hi
yeah u got me right I want that way when ever user sends a request it changes its position. Actually the image will be positioned after a text now the length varies every time a user sends a request for the page...Pls help me out to do this...
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: how do i change position of image in php

Post by social_experiment »

Will the user determine the position of the image? (I.e enter new values?)
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
rajdey1
Forum Newbie
Posts: 6
Joined: Wed Jan 04, 2012 5:46 am

Re: how do i change position of image in php

Post by rajdey1 »

whenever this page is displayed a random text from database is displayed and beside it will be the image ...now the text will be of different length for evry new request and hence the left postion of the image should change accordingly ...how do i write that in php
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: how do i change position of image in php

Post by social_experiment »

Does the text container have a fixed position; this can be used to determine where the image should go.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
rajdey1
Forum Newbie
Posts: 6
Joined: Wed Jan 04, 2012 5:46 am

Re: how do i change position of image in php

Post by rajdey1 »

yes see the value

div.Object2204 { position:absolute; padding-right:5px; top:734px; left:540px; z-index:44; text-align:left; width:149px; }
<div class="Object2204"><span class="textstyle0"><a href="/studentzone/results/2"">Term End Exam Results<br>

but the text "Term End Exam Results" will change with every new request but its position remains same.... Kindly help
rajdey1
Forum Newbie
Posts: 6
Joined: Wed Jan 04, 2012 5:46 am

Re: how do i change position of image in php

Post by rajdey1 »

I got the solution accidently by playing with he code...anyway thanks
Post Reply