SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: WML Question

Hybrid View

  1. #1
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know how to integrate a "Fact of the Day" script into a WML page? I want to keep the content somewhat dynamic but I don't know how to display a different message everyday.

  2. #2
    SitePoint Addict
    Join Date
    Feb 2000
    Location
    District of Columbia
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dominique,

    I am not quite sure how to do that, but try looking on (around) www.wap.com

    They have goog resources and tutorials, I am learning this myself right now

    HTH

  3. #3
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm afraid you'll have to use PHP or ASP. Maybe WMLscript, but there are not a lot of websites that document about that scripting language...
    [blogger: zengun] [blogware contributor: wordpress]

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I cannot say for sure, but I don't think WMLScript would do the trick - it'd be a pain, for sure. WMLScript can be thought of as JavaScript's wireless counterpart.

    Shin Ma, however, is correct: you'll need to use some sort of server-side language, and have it spit out WML code - it's not too tough.

    The only trick to it is to use something like, perhaps, .htaccess to have your server parse .wml files as .php/.asp (depending on what you use). This allows the PHP/ASP code inside to be parsed, but still allows wireless devices to use it with it's .wml extension.

    For PHP, there is a command you'll need to enter to send to the HTTP header though, I believe. If you need that line, let me know.

    It's not too tricky overall: anything you can spit out with PHP/ASP, you can post on a WML page with a little work. You can essentially have a database-driven site in either language, and make the same articles/tutorials/reviews/etc available to wireless users, pulled right out of the database.

  5. #5
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys. I don't know any PHP, is it similarly easy to implement a PHP script as it is to implement a Perl script?

    Right know I'm hoping that I can just do some minor alterations to some existing script available for free. I found the special code to place at the top of the script on www.wap.com.

  6. #6
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It shouldn't be too difficult, assuming you can get Perl code to parse in a .wml file (there might be a different way, I just don't know of any right now). Perl and PHP are very similar.

  7. #7
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also make a whole ASP page with WML tags instead of HTML tags, and declare the MIME-type WML in the ASP headers.
    If you plan on making this your front page, either work this out in .htaccess or set a little redirection page (you'd prefer .htaccess, but some hosts won't allow you to modify this file).
    [blogger: zengun] [blogware contributor: wordpress]

  8. #8
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm..
    If you know PERl, you know 50% php.
    its so similar.
    if i'm ocrrect, php has built insupport for wml? if so, you cna take this query to the PHP forum and get the experts there.

    i have a current php script which randomly display certain text form a file.

    i also have a javascript corresponding file.

    do you want them?
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  9. #9
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lynlimz: That would depend on what you mean by "built-in support" - PHP can spit out WML code without much of a problem - you just need to have your server parse .wml pages for PHP code, and add a line of code to specify in the Document Headers that the file is indeed a WML file.

    So, basically, I'd say PHP supports flexibility with the headers, and will let you configure your server to parse other file extensions as PHP files - which allows you to do many things, one of which is created a WML page dynamically.

  10. #10
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by lynlimz
    i have a current php script which randomly display certain text form a file.

    i also have a javascript corresponding file.

    do you want them?
    I'd love the php script if that's possible. I was looking at some scripts on www.hotscripts.com but I don't know if they can be customized for WML.

    As for the javascript file, I was under the impression Wap phones don't support javascript. Am I wrong?

  11. #11
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, you are correct, I'm 99% sure WAP phones do not support JavaScript - to achieve JavaScript-esque effects, you'd have to use WMLScript. It is to WML what JavaScript is to HTML.


Bookmarks

Posting Permissions

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