The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Mobile Programming
> Mobile Programming
|
Help me check my wap php page
Discuss Help me check my wap php page in the Mobile Programming forum on Dev Shed. Help me check my wap php page Mobile Programming forum discussing development for mobile technologies from basic mark-up languages
such as WML and XHTML MP to server generated code and applications. Widsets, SMS, gateway and server
set up are also covered here.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 11th, 2006, 02:58 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 27
Time spent in forums: 1 h 48 sec
Reputation Power: 0
|
|
|
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>
|

August 11th, 2006, 10:42 AM
|
 |
Retired
|
|
Join Date: Feb 2002
Location: Finland
|
|
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:
<?php
header("Content-type: text/vnd.wap.wml, true");
?>
Also, you need to close all your tags properly.
In this case: <img />
__________________
Cheers,
Jamie
>_ skiFFie ? | Twitter
__________________
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.
__________________
|

August 12th, 2006, 03:28 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 27
Time spent in forums: 1 h 48 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by jabba_29 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:
<?php
header("Content-type: text/vnd.wap.wml, true");
?>
Also, you need to close all your tags properly.
In this case: <img /> |
still doesn't seem to work. the error's at the <a href=> part.
do i have to add ' or " to it?
|

August 12th, 2006, 04:20 AM
|
 |
Retired
|
|
Join Date: Feb 2002
Location: Finland
|
|
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.... 
|

August 12th, 2006, 08:17 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 27
Time spent in forums: 1 h 48 sec
Reputation Power: 0
|
|
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>
|

August 12th, 2006, 08:25 AM
|
 |
Retired
|
|
Join Date: Feb 2002
Location: Finland
|
|
|
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>
|

June 24th, 2010, 01:57 AM
|
|
Registered User
|
|
Join Date: Jun 2010
Posts: 1
Time spent in forums: 8 m 26 sec
Reputation Power: 0
|
|
|
Wap
how to use wap script in php?
|

June 29th, 2010, 04:19 AM
|
 |
Retired
|
|
Join Date: Feb 2002
Location: Finland
|
|
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|