Forum Moderators: bakedjake
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>";
}
?>
u need to use <p> </p> whereever text or images start..
thats whati do..
do check [thewirelessfaq.com...]