943,745 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1417
  • PHP RSS
Jan 7th, 2009
0

WAP+php

Expand Post »
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

PHP Syntax (Toggle Plain Text)
  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>
Similar Threads
Reputation Points: 9
Solved Threads: 4
Junior Poster
queenc is offline Offline
145 posts
since Mar 2008
Jan 7th, 2009
0

Re: WAP+php

xml Syntax (Toggle Plain Text)
  1. <?xml version="1.0" ?>
xml declaration so the php should look something like
php Syntax (Toggle Plain Text)
  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>
php Syntax (Toggle Plain Text)
  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.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Jan 8th, 2009
0

Re: WAP+php

Line 2: Start tag expected, '<' not found.
it is showing the above error
Reputation Points: 9
Solved Threads: 4
Junior Poster
queenc is offline Offline
145 posts
since Mar 2008
Jan 8th, 2009
0

Re: WAP+php

php Syntax (Toggle Plain Text)
  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.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Jan 9th, 2009
0

Re: WAP+php

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
Reputation Points: 9
Solved Threads: 4
Junior Poster
queenc is offline Offline
145 posts
since Mar 2008
Jan 9th, 2009
0

Re: WAP+php

try taking out the \ from first line. They don't belong there anymore.
Reputation Points: 28
Solved Threads: 3
Light Poster
Rayhan Muktader is offline Offline
30 posts
since Oct 2006
Jan 9th, 2009
0

Re: WAP+php

try taking out the \ from first line. They don't belong there anymore.
forehead slap moment, Sorry
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Jan 10th, 2009
0

Re: WAP+php

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:

PHP Syntax (Toggle Plain Text)
  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.
PHP Syntax (Toggle Plain Text)
  1. <?php
  2.  
  3. header('Content-Type: text/xml');
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: preg_replace Help
Next Thread in PHP Forum Timeline: PHP Feedback Form





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC