-
PHP (
http://www.daniweb.com/forums/forum17.html)
- -
WAP+php (
http://www.daniweb.com/forums/thread166741.html)
| queenc | Jan 7th, 2009 6:30 am | |
| WAP+php 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
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\">";
?>
<wml>
<card>
<?
require_once('./common/dblayer1.php');
$query = "select * from login";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
{
echo $row[0];
}
?>
</card>
</wml> |
| almostbob | Jan 7th, 2009 1:42 pm | |
| Re: WAP+php <?xml version="1.0" ?> xml declaration so the php should look something like
<?php
echo "<?xml version=\"1.0\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card>
<?php /* declare script type short tags may be off other script languages may be available saves debugging later*/
require_once('./common/dblayer1.php');
$query = "select * from login";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) { echo $row[0]; }
?>
</card>
</wml> <?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\">";
?>
<wml>
<card>
<?
require_once('./common/dblayer1.php');
$query = "select * from login";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
{
echo $row[0];
}
?>
</card>
</wml> |
| queenc | Jan 8th, 2009 5:23 am | |
| Re: WAP+php Line 2: Start tag expected, '<' not found.
it is showing the above error |
| almostbob | Jan 8th, 2009 7:15 am | |
| Re: WAP+php <?xml version=\"1.0\" ?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1 EN "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card>
<?php
require_once('./common/dblayer1.php');
$query = "select * from login";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) { echo $row[0]; }
?> </card></wml>
maybe |
| queenc | Jan 9th, 2009 1:11 am | |
| 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 |
| Rayhan Muktader | Jan 9th, 2009 2:58 am | |
| Re: WAP+php try taking out the \ from first line. They don't belong there anymore. |
| almostbob | Jan 9th, 2009 5:23 pm | |
| Re: WAP+php Quote: Originally Posted by Rayhan Muktader (Post 774235) try taking out the \ from first line. They don't belong there anymore. | forehead slap moment, Sorry |
| digital-ether | Jan 10th, 2009 11:02 pm | |
| 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
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
header('Content-Type: text/xml'); |
| All times are GMT -4. The time now is 12:31 am. | |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC