WAP+php

Reply

Join Date: Mar 2008
Posts: 145
Reputation: queenc is an unknown quantity at this point 
Solved Threads: 4
queenc's Avatar
queenc queenc is offline Offline
Junior Poster

WAP+php

 
0
  #1
Jan 7th, 2009
hi
i am trying to develop a site.i am using php and wml.this is my first program.can any one say why my below code is not woking

  1. <?php
  2. header("Content-type: text/vnd.wap.wml");
  3. echo " xml version=\"1.0\" ";
  4. echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
  5. . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
  6.  
  7. ?>
  8. <wml>
  9. <card>
  10. <?
  11. require_once('./common/dblayer1.php');
  12. $query = "select * from login";
  13. $result = mysql_query($query);
  14. while ($row = mysql_fetch_array($result))
  15. {
  16. echo $row[0];
  17. }
  18. ?>
  19. </card>
  20. </wml>
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,318
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: WAP+php

 
0
  #2
Jan 7th, 2009
  1. <?xml version="1.0" ?>
xml declaration so the php should look something like
  1. <?php
  2. echo "<?xml version=\"1.0\" ?>";
  3. echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
  4. . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
  5. ?>
  6. <wml>
  7. <card>
  8. <?php /* declare script type short tags may be off other script languages may be available saves debugging later*/
  9. require_once('./common/dblayer1.php');
  10. $query = "select * from login";
  11. $result = mysql_query($query);
  12. while ($row = mysql_fetch_array($result)) { echo $row[0]; }
  13. ?>
  14. </card>
  15. </wml>
  1. <?php
  2. header("Content-type: text/vnd.wap.wml");
  3. echo " xml version=\"1.0\" ";
  4. echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
  5. . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
  6.  
  7. ?>
  8. <wml>
  9. <card>
  10. <?
  11. require_once('./common/dblayer1.php');
  12. $query = "select * from login";
  13. $result = mysql_query($query);
  14. while ($row = mysql_fetch_array($result))
  15. {
  16. echo $row[0];
  17. }
  18. ?>
  19. </card>
  20. </wml>
Last edited by peter_budo; Jan 9th, 2009 at 6:15 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 145
Reputation: queenc is an unknown quantity at this point 
Solved Threads: 4
queenc's Avatar
queenc queenc is offline Offline
Junior Poster

Re: WAP+php

 
0
  #3
Jan 8th, 2009
Line 2: Start tag expected, '<' not found.
it is showing the above error
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,318
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: WAP+php

 
0
  #4
Jan 8th, 2009
  1. <?xml version=\"1.0\" ?>
  2. <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1 EN "http://www.wapforum.org/DTD/wml_1.1.xml">
  3. <wml>
  4. <card>
  5. <?php
  6. require_once('./common/dblayer1.php');
  7. $query = "select * from login";
  8. $result = mysql_query($query);
  9. while ($row = mysql_fetch_array($result)) { echo $row[0]; }
  10. ?> </card></wml>

maybe
Last edited by peter_budo; Jan 9th, 2009 at 6:16 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 145
Reputation: queenc is an unknown quantity at this point 
Solved Threads: 4
queenc's Avatar
queenc queenc is offline Offline
Junior Poster

Re: WAP+php

 
0
  #5
Jan 9th, 2009
Line 1: String not started expecting ' or "
Line 1: Malformed declaration expecting version
Line 1: Blank needed here
Line 1: parsing XML declaration: '?>' expected
Line 2: SystemLiteral " or ' expected
Line 2: PUBLIC, the Public Identifier is missing
Line 2: Space required after the Public Identifier
Line 2: SystemLiteral " or ' expected
Line 2: SYSTEM or PUBLIC, the URI is missing
Line 2: DOCTYPE improperly terminated
Line 2: Start tag expected, '<' not found
these are the errors.i am WAP proof to execute my code.plz do tell me whether i right
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 30
Reputation: Rayhan Muktader is an unknown quantity at this point 
Solved Threads: 3
Rayhan Muktader Rayhan Muktader is offline Offline
Light Poster

Re: WAP+php

 
0
  #6
Jan 9th, 2009
try taking out the \ from first line. They don't belong there anymore.
I don't reply to private messages.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,318
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: WAP+php

 
0
  #7
Jan 9th, 2009
Originally Posted by Rayhan Muktader View Post
try taking out the \ from first line. They don't belong there anymore.
forehead slap moment, Sorry
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,075
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: WAP+php

 
0
  #8
Jan 10th, 2009
You probably have short open tags enabled in the PHP config. So it would see the xml declaration as an opening PHP tag.

In PHP.ini disable short open tags by finding "short_open_tag" and making the value "0".

You can also seperate the < and ? in <?xml so it doesn't look like a PHP open tag (<?).

eg:

  1. <?php
  2. echo "<"."?xml version=\"1.0\" ?>";

notice that you have "<"."?xml instead of "<?xml.

You can also remove the xml declaration, and use the HTTP content-type header.
  1. <?php
  2.  
  3. header('Content-Type: text/xml');
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC