|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Help me check my wap php page
hi, I've just converted my index.wml file to php to use the dynamic features of php.
Here's what i add to the wml to make it into index.php: Code:
<?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\">";
?>
- Original WML code -
am i doing it right? Then when i tried to add a php feature (a dynamic image banner) into the wml part of the script, something goes wrong. It loads correctly on my phone, but it doesn't when i tried to view it on Opera or wap emulator. This is the code that i tried to add into the WML section of my code: Code:
<p align="center">
<?
$adsid = rand(1, 240);
$ts = time();
echo("<a href=http://click.buzzcity.com/click.php?bid=$adsid&partnerid=1234&ts=$ts><img
src=http://ads.buzzcity.com/show.php?bid=$adsid&partnerid=1234&ts=$ts></a>");
?></p>
|
|
#2
|
||||
|
||||
|
Your &'s need to be &'s
I would also avoid using php short tags (<?) too, as it can sometimes cause confusion with xml tags... Do you get any errors with Opera? Additionally, I have found that setting the header as follows sometimes makes a difference: PHP Code:
Also, you need to close all your tags properly. In this case: <img />
__________________
Cheers, Jamie # skiFFie | Home of the 'accessibility module' for Drupal # Jamie Burns [me] Accessibility Module [drupal] # guidelines | search | wap resources | not getting help | fold to cure # Any form of employment is strictly prohibited ...... __________________ Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. __________________ |
|
#3
|
|||
|
|||
|
Quote:
still doesn't seem to work. the error's at the <a href=> part. do i have to add ' or " to it? |
|
#4
|
||||
|
||||
|
Yes, I missed that.
You need to use valid xml/wml..... This means you must quote all your attributes and close all tags... See the WAP Resources sticky - there is a link to a wml validator there - use it.... ![]() |
|
#5
|
|||
|
|||
|
tried the validator but it says fatal error:
here's what i have: Code:
<p align="center">
<?php
header("Content-type: text/vnd.wap.wml, true");
$adsid = rand(1, 240);
$ts = time();
echo("<a href="http://click.buzzcity.com/click.php?bid=$adsid&partnerid=1234&ts=$ts"><img
src="http://ads.buzzcity.com/show.php?bid=$adsid&partnerid=1234&ts=$ts" /></a>");
?></p>
|
|
#6
|
||||
|
||||
|
You must send the header before anything is sent to the browser:
is: before <p ..... in this case. Show your outputted source code... this link / text must be within the <card> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > Help me check my wap php page |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|