Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 3rd, 2004, 02:38 PM
philou54 philou54 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 philou54 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry HELP ME!!!! php+wml

I make a wap site which is generated by a php script. It works well in emulators, when I put the header right, but not in my mobile. When I remove the header it works on my mobile but not the way I would like. In fact it displays all the content and it does not separate the different card that I generate.... I tried all I know!!! Here is the source:
<?php
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\">";


echo"<wml>\n";
$configpath="..";
include("../config.inc.php");
include("../mysql.config.php");
$result=mysql_connect("$hostname", "$username", "$passwordsql");
mysql_select_db("$bdd");
$query=mysql_query("SELECT * FROM identification WHERE num = '$login' AND pass = '$mdp'");
if(mysql_num_rows($query)=="0") die("<card>\n<p>Mot de passe incorrect ou pas inscrit sur le tutoweb.net</p>\n</card>\n</wml>");

//Menu Wap

echo "<card id=\"menu\" title=\"Colles\">\n";
$planning=file("../planningcolles.txt");
foreach($planning as $ligne){
$ducon=explode(" : ",$ligne);
$datejourmoiscolle=substr($ducon[2],0,2)."/".substr($ducon[2],2,2);
if(file_exists("../stats/$ducon[0]/stat-$ducon[0].web")) echo "<p><a href=\"#$ducon[0]\">*$ducon[1] du $datejourmoiscolle*</a></p>\n";
}
if(!$ducon) echo "<p>Aucune colle disponible</p>\n";
echo "</card>\n";

//Cartes des résultats
foreach($planning as $ligne){
$ducon=explode(" : ",$ligne);
if(file_exists("../stats/$ducon[0]/stat-$ducon[0].web")){
echo "<card id=\"$ducon[0]\" title=\"$ducon[1] du $datejourmoiscolle\">\n";

//Affichage du classement de la personne
$file=file("../stats/$ducon[0]/stat-$ducon[0].web");
foreach($file as $line){
$ligne=explode(":",$line);

if($ligne[0]==$login){
$note=$ligne[1];
$clsst1=$ligne[2];
$clsst2=$ligne[3];
$clsst3=$ligne[4];
echo"<p><b>Note:</b> $note/20</p>\n";
echo"<p><b>Medecine:</b>";
if($clsst1==0){
echo"Pas inscrit</p>\n";
}else{
if($clsst1!=1) echo "$clsst1"." eme</p>\n"; else echo "$clsst1"." er</p>\n";
if($clsst1==1) echo"<p><i>Bravo tu es major de la colle!!</i></p>\n";
}

echo"<p><b>Kine:</b>";
if($clsst2==0){
echo"Pas inscrit</p>\n";
}else{
if($clsst2!=1) echo"$clsst2"." eme</p>\n"; else echo"$clsst2"." er</p>\n";
if($clsst2==1) echo"<p><i>Bravo tu es major de la colle!!</i></p>\n";
}

echo"<p><b>Ergo:</b>";
if($clsst3==0){
echo"Pas inscrit</p>\n";
}else{
if($clsst3!=1) echo"$clsst3"."eme</p>\n"; else echo"$clsst3"."er</p>\n";
if($clsst3==1) echo"<p><i>Bravo tu es major de la colle!!</i></p>\n";
}
}

if($ligne[0]=="/stats"){

echo "<p><b>Effectif:</b> $ligne[1]</p>\n";
echo "<p><b>Moyenne:</b> $ligne[2]/20</p>\n";
echo "<p><b>Note major:</b> $ligne[3]/20</p>\n";
}
}
echo "<p><a href=\"#menu\">Retour</a></p>\n";
echo "</card>\n";

}
}

echo"</wml>";
?>

I tried to change the position of the <wml>, tried to remove something but anyway. Please help me!!!! When I remove the header all is shown: like that: (it's in French but don't care)
*Anatomie du 23/02*
*Physiologie du 23/02*
*Histologie du 01/03*
*Anatomie du 08/03*
*Rea-Reeduc du 08/03*
*Physiologie du 15/03*
*Statistiques du 22/03*
*Chimie du 29/03*
Note: 8,6/20
Medecine:258 eme
Kine:148 eme
Ergo:103 eme
Effectif: 560
Moyenne: 8,6/20
Note major: 16,2/20
Retour
Note: 9/20
Medecine:278 eme
Kine:158 eme
Ergo:110 eme
Effectif: 533
Moyenne: 9,53/20
Note major: 16,8/20
Retour
Note: 9/20
Medecine:210 eme
Kine:115 eme
Ergo:75 eme
Effectif: 568
Moyenne: 8,21/20
Note major: 14,7/20
Retour
Note: 9,4/20
Medecine:267 eme
Kine:146 eme
Ergo:108 eme
Effectif: 570
Moyenne: 9,37/20
Note major: 17,4/20
Retour
Note: 0/20
Medecine:106 eme
Kine:115 eme
Ergo:82 eme
Effectif: 125
Moyenne: 9,51/20
Note major: 13,7/20
Retour
Note: 10,29/20
Medecine:303 eme
Kine:176 eme
Ergo:120 eme
Effectif: 571
Moyenne: 10,3/20
Note major: 17,6/20
Retour
Note: 9,61/20
Medecine:192 eme
Kine:98 eme
Ergo:63 eme
Effectif: 393
Moyenne: 9,61/20
Note major: 19,03/20
Retour
Note: 0/20
Medecine:94 eme
Kine:59 eme
Ergo:48 eme
Effectif: 97
Moyenne: 10,11/20
Note major: 20/20
Retour

In fact it should create links in card which is done in certain model phones but not all!!!
Thanks a lot!!
phil

Reply With Quote
  #2  
Old April 7th, 2004, 01:38 PM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,756 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 6 Days 20 m 42 sec
Reputation Power: 1632
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
Bit difficult to test when I don't have you DB connection but try changing your first line to:
PHP Code:
 header('Content-Type: text/vnd.wap.wml'true); 

See if that helps. You could also maybe escape the PHP momentarily , see if that is causing a problem
PHP Code:
print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<?php
// rest of your php stuff here 
HTH.
__________________
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


__________________

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.



__________________

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > HELP ME!!!! php+wml


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway