...

View Full Version : php mysql n wap problem



hmvrulz
03-05-2007, 12:47 PM
i have writen a code to get the post from a db of guestbook..

when i can the file it say


Wrong mime-type, I got text/html, but I want text/vnd.wap.wml.
This error occurs when you request a page that is not a WAP page, or when the webserver isn't set up correctly for hosting WAP sites

but i have used the same wml header previously...

heres my code...



<? 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\">"; ?>

<?php

//open connection
$connection = mysql_connect("192.168.2.7", "***", "****");

// Using the database
mysql_select_db("phpmysql_guestbook",$connection);

// get the post
$get_posts = "SELECT id, name, place, phone, email, message, date_format(entry_date, '%b %e %Y at %r') as post_time from guestbook where id = $_GET[id]";

// getting it from db
$get_posts_res = mysql_query($get_posts,$connection) or die(mysql_error())

while($post_info = mysql_fetch_array($get_posts_res)){
// Build your formatted results here.

$post_id = $post_info['id'];
$post_creater = stripslashes($post_info['name']);
$post_palce = $post_info['place'];
$post_phone = $post_info['phone'];
$post_email = $post_info['email'];
$post_mess = nl2br(stripslashes($post_info['message']));
$post_time = $post_info['post_time'];

$display_block .="<big><b>$post_creater :</b></big><br />
<i><small>$post_mess</small></i><br />
<small>
$post_palce<br />
$post_phone<br />
$post_email<br />
$post_time<br /></small>";

}
?>

<wml>
<card>
<?php echo $display_block; ?>

</card>
</wml>


u can see the file at

http://www.gnuer.com/hmv/wap/post.php?id=1

and when i call the file thru web browser it says


Parse error: syntax error, unexpected T_WHILE in /home/phpmysql/public_html/hmv/wap/post.php on line 20


and the 20th line is


while($post_info = mysql_fetch_array($get_posts_res)){
// Build your formatted results here.

Inigoesdr
03-05-2007, 01:12 PM
Put a colon after the previous line:

// getting it from db
$get_posts_res = mysql_query($get_posts,$connection) or die(mysql_error());



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum