homepage Welcome to WebmasterWorld Guest from 23.20.34.25
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Smartphone, Wireless, and Mobile Technologies
Forum Library, Charter, Moderators: bakedjake

Smartphone, Wireless, and Mobile Technologies Forum

    
Help with WML Pages
SpeedX




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

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:
<?php
//connect to the mysql database
include("connect.php");
$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";
$fp=fopen($itemfile,'r');
$fp=fopen($itemfile,'r');

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

//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");
}

else{
// 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'>";
/*PAGE DATA START*/
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\" />";
/*PAGE DATA END*/
echo "</card>";
echo "</wml>";
}
?>

 

SpeedX




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

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 :)

varunkrish




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

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...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Smartphone, Wireless, and Mobile Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved