Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

How to make live image positioning possible?

I am working a Social Network of mine. When I upload a picture, it automatically centers the pictue and uses it as profile cover. The thing is I want the user to choose how to position it while it is uploaded. I guess I have to use PHP to do it. Any clues on how to do so? In the meanwhile, I will be making searches on Google to find any answer.

Of course, I want the final position to be saved.
Anything lost, can be found again except for time wasted.
A vision without action is merely a dream. Action is the grind, it's the hustle, it's the persistance.
You would have to use javascript. You will use ajax to save the changes made.

PHP is server sided. Javascript is client sided. For the user to be able to interact with the website like drag a picture around it's done on the client side. So, javascript will give you that effect where you can drag the image and then click a button to save it. Once the image is save it will look for that images id or name. You then grab it's css value for left and right etc it's position. Then take those position values and then using ajax you post them back to your php script which will first make sure the values are numbers and then you can save it. Then when you have to display the image you would have to grab these values from your database and insert them in the css code for the position values.

Hope this helps any. I just gave you the concept. Good Luck 🤝

Also look into jquery UI they have dragging and resize features already made. I myself already have a working code already made. So, I already done this process that you're going thru but more complex then what you're trying to do.
jQuery and jQuery UI will probably come in handy.
/* No comment */


Possibly Related Threads...
Thread / Author Replies Views Last Post
[The Brotherhood] by VinavilMar 27, 2026 09:05 AM 25 852 Mar 27, 2026 09:05 AM
Last Post: Vinavil
[PHP] by Jack DrakeApr 14, 2019 09:42 PM 8 181 Apr 14, 2019 09:42 PM
Last Post: Jack Drake
[PHP] by blackknight_Aug 2, 2014 08:35 AM 1 92 Aug 2, 2014 08:35 AM
Last Post: AppleJuice