|
Posted by Oli Filth on 10/13/35 11:28
Buzz wrote:
> Please can anyone advise on how to use PHP to print an image for WAP.
> No other forums have been able to help. Not sure if it's an XML thing
> or a WAP server push thing or something else.
>
> I can get print to work with .jpgs on a www. page or through a mobile
> phone browser (transitional doctype) :
>
> <h4>Picture of the day:</h4>
> <?php
> $image_path = "../images/mobile";
> $images =
> array('image_sun.jpg','image_mon.jpg','image_tue.jpg','image_wed.jpg','image_thu.jpg','image_fri.jpg','image_sat.jpg');
> $day_of_week = date("w");
> print("<img src=\"$image_path/$images[$day_of_week]\" alt=\"pic of the
> day\" />");
> ?>
>
> The following does not work (all other aspects apart from the images
> work):
>
> <?php
> // send wml headers
> header("Content-type: text/vnd.wap.wml");
> echo "<?xml version=\"1.0\"?>";
> echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
> . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
> ?>
> <wml>
> <card title="....." id="tuesday">
> <?php
> // printing picture of the week with an array
> $image_path = "../images/mobile";
> $images =
> array('sunday.wbmp','monday.wbmp','tuesday.wbmp','wednesday.wbmp','thursday.wbmp','friday.wbmp','saturday.wbmp');
> $day_of_week = date("w");
> print("<img src=\"$image_path/$images[$day_of_week]\" alt=\"day of the
> week\" />");
> ?>
> </p>
> ......
> <a href="wap.php">Back: Home</a></p>
> </card>
> </wml>
>
This is clearly a WML issue, not PHP. Check that PHP is generating the
correct WML markup.
--
Oli
Navigation:
[Reply to this message]
|