I have a coupon in the middle of my webpage. I want to insert today's date in the image. I tried Insert-Date, but that adds the date next to the image. I need to precisely position the date in one section of the coupon.
Out of all the cases you will read on these forums about not using positioning, this is a case where it must happen. To make this work you can make the image a background of a fixed size container (div with set dimensions) and then position the "date" layer over the image.
You do mention that this is in the center of your webpage. If this is something likely to be printed then you might be better using an image in the center of your webpage, followed by a printable webpage with the actual date printed in the coupon.
http://savcp.com/index-coupon-800.html
I want to replace the date on the coupon with the current date, so it changes every day.
On this URL:
http://savcp.com/coupon-400-01-wht.html
<img src="images/coupon-400-01.jpg" alt="coupon" name="coupon" id="coupon" height="261" width="576">
<p style="position:absolute; top:226px; left:180px; font-size: 21px; color:red"><?php $theDate = date("m/d/y"); echo "$theDate"; ?><p>
Nancy O.
Then you're not on a Windows server. You're on a Linux server. ![]()
Copy & paste this into a new, blank document. Save As .php document.
Upload to test.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Coupon White</title>
<style type="text/css">
#coupon {
position:relative;
}
#coupon p {
position:absolute;
top:198px;
left:125px;
background:#FFF;
font-size: 18px;
font-weight:bold;
color:red;
}
</style>
</head>
<body>
<div id="coupon">
<img src="http://savcp.com/images/coupon-800-01.jpg"
alt="coupon" name="coupon" id="coupon" height="261" width="576">
<p>Offer good until
<?php $theDate = date("m/d/y"); echo "$theDate"; ?>.
One per customer</p>
</div>
Nancy O.
North America
Europe, Middle East and Africa
Asia Pacific