Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    137
    Thanks
    5
    Thanked 0 Times in 0 Posts

    php mysql n wap problem

    i have writen a code to get the post from a db of guestbook..

    when i can the file it say

    Code:
    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...

    PHP 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

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

    and the 20th line is

    PHP Code:
    while($post_info mysql_fetch_array($get_posts_res)){ 
        
    // Build your formatted results here. 

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Put a colon after the previous line:
    PHP Code:
    // getting it from db
    $get_posts_res mysql_query($get_posts,$connection) or die(mysql_error()); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •