how to show image overlay with php
I have a real estate site and I want to show a sold or under contract over the image when a tick box is selected in the admin.
How do I do this? I realize its both php and CSS any help..
I have a real estate site and I want to show a sold or under contract over the image when a tick box is selected in the admin.
How do I do this? I realize its both php and CSS any help..
while there is some complexity here, I will try to get you pointed in the right direction.
First, yes you will need PHP to determine if the check box/database was updated with the check.
The basics would be to add a column in the database for sold. I would make the default entry "0" and then if you were to check the box, it would update the database to be "1". In other words, 0 meaning not sold and 1 meaning sold.
In your page, say you have a picture of your house in a div.
<div>Picture</div>
Below that you can then add your if statement.
Use PHP to check if the value for sold in that row is 1. If it is equal to 1, then you generate a new div with your sold graphic in that.
Lastly, you will want to set the position of that div to relative and preferably to the exact dimensions of your image. You will need to then set the Z-Index attribute high (like 100) and then begin to position the div with negative margins to show up over top the house pic.
For example, to get over the bottom right corner, you may have to set it to margin-top: -120px; margin-left: 50px;. That's just an arbitrary example of how a picture that was say 100px high would be placed.
Regards
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.