Page 1 of 1

how do i change position of image in php

Posted: Wed Jan 04, 2012 6:46 am
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

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 6:57 am
by social_experiment
Im not sure how but i would say it involves using javascript to rewrite the new values on the fly.

Hth

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 7:02 am
by rajdey1
Hi
I dont want to do it in php not javascript

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 7:17 am
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.

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 7:30 am
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...

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 7:34 am
by social_experiment
Will the user determine the position of the image? (I.e enter new values?)

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 7:42 am
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

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 7:49 am
by social_experiment
Does the text container have a fixed position; this can be used to determine where the image should go.

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 7:54 am
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

Re: how do i change position of image in php

Posted: Wed Jan 04, 2012 8:45 am
by rajdey1
I got the solution accidently by playing with he code...anyway thanks