Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

Help with WML Pages



1:18 pm on May 20, 2005 (gmt 0)

10+ Year Member

Hi, I have a problem, the code below works fine for both my nokia and my samsung phones, however when i try to load it on a sony erricson phone it displays "something is wrong with the page you are trying to visit"

I understand I should use a text/wml header somewhere, however no-matter where I place it on the page, the site will not load on any of the phones!

Now the code:

//connect to the mysql database
$table = "personalid";

//query the mysql database
$sidrows = mysql_query("SELECT * FROM $table WHERE ID=$id ")
or die("Error in Query");

while($myrow = mysql_fetch_array($sidrows))
$title = $myrow["title"];
$artist = $myrow["artist"];
$path = $myrow["path"];
$available = $myrow["available"];
$originalid = $myrow["originalid"];

//verify ringtone has not been previously downloaded or deactivated
if($available!= 1){
die("an error occured");

if($download == "1"){
//download the file
$itemfile = $path;
$itemname = $title . ".mid";

header("Content-Type: audio/midi");
header("Content-Disposition: attachment; filename=\"$itemname\"");
while (!feof($fp))
echo $contents;

//render the id used and unavailable
mysql_query("UPDATE `personalid` SET `available` = '0' WHERE `ID` = '$id' LIMIT 1");
//add the download ip to the database
mysql_query("UPDATE `personalid` SET `downloadaddr` = '$REMOTE_ADDR' WHERE `ID` = '$id' LIMIT 1");

// send wml headers
echo "<?xml version=\"1.0\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml><card id=\"get\" title=\"Download\">";
echo "<p align='center'>";
echo "$artist - $title <br/><br/><a href=\"$PHP_SELF?id=$id&download=1\">Click Here To Download</a><br/><br/><img src=\"/images/waplogo.png\" alt=\"2005 JSNokia\" />";
echo "</card>";
echo "</wml>";


1:19 pm on May 20, 2005 (gmt 0)

10+ Year Member

And just to let you know, that this was all coded by me so it may look a little sloppy as im not brilliant at coding yet :)


9:05 am on Jun 3, 2005 (gmt 0)

10+ Year Member

please note that wml code either native wml or php generated wml pust adhere to the eml standards.

u need to use <p> </p> whereever text or images start..

thats whati do..

do check [thewirelessfaq.com...]


Featured Threads

Hot Threads This Week

Hot Threads This Month