Problem On Converting To Wml

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem On Converting To Wml

    i have problem on converting this to WML lavalair compatible... can somebody help me to convert this script???

    Code:
    <?php
    
    ############################################################################
    ############################################################################
    ##                                                                        ##
    ## This script is copyright Rupe Parnell (Starsol.co.uk) 2003.            ##
    ##                                                                        ##
    ## Distribution of this file, and/or any other files in this package, via ##
    ## any means, withour prior written consent of the author is prohibited.  ##
    ##                                                                        ##
    ## Starsol.co.uk takes no responsibility for any damages caused by the    ##
    ## usage of this script, and does not guarantee compability with all      ##
    ## servers.                                                               ##
    ##                                                                        ##
    ## Please use the contact form at                                         ##
    ## [url]http://www.starsol.co.uk/scripts/contact.php[/url] if you need any help or   ##
    ## have any questions about this script.                                  ##
    ##                                                                        ##
    ############################################################################
    ############################################################################
    
    require(&#39;pss_variables.php&#39;);
    $version = "v1.03";
    $pscore = $_GET[&#39;pscore&#39;];
    $cscore = $_GET[&#39;cscore&#39;];
    $guess = $_GET[&#39;guess&#39;];
    ?>
    
    <?php // Enter all HTML you want to appear ABOVE the Paper, Scissors Stone script output between this line ?>
    
    <html>
    <head>
    <title>Paper, Scissors, Stone</title>
    </head>
    
    <body>
    
    <hr>
    
    <?php // and this line ?>
    
    <?php
    
    echo"
    <p align=&#39;center&#39;>
    <font face=&#39;$fontface&#39; size=&#39;4&#39;>[b][u]
    Paper, Scissors, Stone
    [/u][/b]</font>
    </p>
    
    <p align=&#39;center&#39;>
    ";
    
    if (!$pscore){
        $pscore=&#39;0&#39;;
    }
    if (!$cscore){
        $cscore=&#39;0&#39;;
    }
    $pscore = HTMLSpecialChars($pscore);
    $cscore = HTMLSpecialChars($cscore);
    $guess = HTMLSpecialChars($guess);
    $number = rand(1,3);
    if ($guess == 1) {
        $pchoice = "Paper";
            if ($number == 1) {
                $cchoice = "Paper";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,drew);
            }
            if ($number == 2) {
                $cscore = $cscore + 1;
                $cchoice = "Scissors";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,lost);
            }
            if ($number == 3) {
                $pscore = $pscore + 1;
                $cchoice = "Stone";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,won);
            }
    }
    if ($guess == 2) {
        $pchoice = "Scissors";
            if ($number == 1) {
                $pscore = $pscore + 1;
                $cchoice = "Paper";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,won);
            }
            if ($number == 2) {
                $cchoice = "Scissors";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,drew);
            }
            if ($number == 3) {
                $cscore = $cscore + 1;
                $cchoice = "Stone";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,lost);
            }
    }
    if ($guess == 3) {
        $pchoice = "Stone";
            if ($number == 1) {
                $cscore = $cscore + 1;
                $cchoice = "Paper";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,lost);
            }
            if ($number == 2) {
                $pscore = $pscore + 1;
                $cchoice = "Scissors";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,won);
            }
            if ($number == 3) {
                $cchoice = "Stone";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,drew);
            }
    }
    
    echo "</p>
    <p align=&#39;center&#39;>
    <font face=&#39;$fontface&#39; size=&#39;3&#39;>
    Play: [url="&#39;pss.php?guess=1&pscore=$pscore&cscore=$cscore&#39;>Paper</a>,"]Scissors[/url] or <a href=&#39;pss.php?guess=3&pscore=$pscore&cscore=$cscore&#39;>Stone</a>?
    </font>
    
    
    </p>
    
    <p align=&#39;center&#39;>
    <font face=&#39;$fontface&#39; size=&#39;1&#39; color=&#39;#888888&#39;>
    Powered by: [url="&#39;http://www.starsol.co.uk/scripts/&#39;"]Starsol[/url] [i]Paper, Scissors, Stone game[/i] $version.
    </font>
    
    
    </p>";
    ?>
    
    <?php // Enter all HTML you want to appear BELOW the Paper, Scissors Stone script output between this line ?>
    
    <hr>
    
    </body>
    </html>
    
    <?php // and this line ?>
    
    
    <?php // Nothing needs to be edited below this line unless you know what you are doing.
    
    function echo_scores($pscore,$cscore,$pchoice,$cchoice,$wld){
    
        global $player,$player_width,$player_height,$comp,$comp_width,$comp_height,$fontface;
    
        if ($wld == "won"){
            $text = "You chose $pchoice. The computer chose $cchoice. You won.";
        }
        if ($wld == "lost"){
            $text = "You chose $pchoice. The computer chose $cchoice. You lost.";
        }
        if ($wld == "drew"){
            $text = "You chose $pchoice. So did the computer. You drew.";
        }
    
        echo "<table width=&#39;100%&#39; border=&#39;0&#39; cellpadding=&#39;1&#39; cellspacing=&#39;1&#39;><tr><td width=&#39;50%&#39; align=&#39;center&#39;><img src=&#39;$player&#39; width=&#39;$player_width&#39; height=&#39;$player_height&#39;><font face=&#39;$fontface&#39; size=&#39;6&#39;>[b]$pscore[/b]</font></td><td width=&#39;50%&#39; align=&#39;center&#39;><font face=&#39;$fontface&#39; size=&#39;6&#39;>[b]$cscore[/b]</font><img src=&#39;$comp&#39; width=&#39;$comp_width&#39; height=&#39;$comp_height&#39;></td></tr><tr><td align=&#39;center&#39; colspan=&#39;2&#39;><font face=&#39;$fontface&#39; size=&#39;3&#39;>$text</td></tr></table>";
    
        return;
    }
    
    ?>

    #2
    Code:
    <?php
    
    ############################################################################
    ############################################################################
    ##                                                                        ##
    ## This script is copyright Rupe Parnell (Starsol.co.uk) 2003.            ##
    ##                                                                        ##
    ## Distribution of this file, and/or any other files in this package, via ##
    ## any means, withour prior written consent of the author is prohibited.  ##
    ##                                                                        ##
    ## Starsol.co.uk takes no responsibility for any damages caused by the    ##
    ## usage of this script, and does not guarantee compability with all      ##
    ## servers.                                                               ##
    ##                                                                        ##
    ## Please use the contact form at                                         ##
    ## [url]http://www.starsol.co.uk/scripts/contact.php[/url] if you need any help or   ##
    ## have any questions about this script.                                  ##
    ##                                                                        ##
    ############################################################################
    ############################################################################
    
    //require(&#39;pss_variables.php&#39;);
    $version = "v1.03";
    $pscore = $_GET[&#39;pscore&#39;];
    $cscore = $_GET[&#39;cscore&#39;];
    $guess = $_GET[&#39;guess&#39;];
    
    
    header("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    echo "<?xml version=\"1.0\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    $time=date("H:i");
    echo "<wml>";
    
    echo "<card id=\"card1\" title=\"Paper, Scissors, Stone\">";
    echo "<p align=\"center\">";
    echo "[size="1"]";
    
    echo "Paper, Scissors, Stone";
    echo "
    
    ";
    
    
    
    
    if (!$pscore){
        $pscore=&#39;0&#39;;
    }
    if (!$cscore){
        $cscore=&#39;0&#39;;
    }
    $pscore = HTMLSpecialChars($pscore);
    $cscore = HTMLSpecialChars($cscore);
    $guess = HTMLSpecialChars($guess);
    $number = rand(1,3);
    if ($guess == 1) {
        $pchoice = "Paper";
            if ($number == 1) {
                $cchoice = "Paper";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,drew);
            }
            if ($number == 2) {
                $cscore = $cscore + 1;
                $cchoice = "Scissors";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,lost);
            }
            if ($number == 3) {
                $pscore = $pscore + 1;
                $cchoice = "Stone";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,won);
            }
    }
    if ($guess == 2) {
        $pchoice = "Scissors";
            if ($number == 1) {
                $pscore = $pscore + 1;
                $cchoice = "Paper";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,won);
            }
            if ($number == 2) {
                $cchoice = "Scissors";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,drew);
            }
            if ($number == 3) {
                $cscore = $cscore + 1;
                $cchoice = "Stone";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,lost);
            }
    }
    if ($guess == 3) {
        $pchoice = "Stone";
            if ($number == 1) {
                $cscore = $cscore + 1;
                $cchoice = "Paper";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,lost);
            }
            if ($number == 2) {
                $pscore = $pscore + 1;
                $cchoice = "Scissors";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,won);
            }
            if ($number == 3) {
                $cchoice = "Stone";
                echo_scores($pscore,$cscore,$pchoice,$cchoice,drew);
            }
    }
    
    echo "Play: <a href=&#39;pss.php?guess=1&amp;pscore=$pscore&amp;cscore=$cscore&#39;>Paper</a>"; 
    echo " <a href=&#39;pss.php?guess=2&amp;pscore=$pscore&amp;cscore=$cscore&#39;>Scissors</a>"; 
    echo " or <a href=&#39;pss.php?guess=3&amp;pscore=$pscore&amp;cscore=$cscore&#39;>Stone</a>";
    
    
    echo "
    
    ";
    echo "Powered by:<a href=&#39;http://www.starsol.co.uk/scripts&#39;>Paper, Scissors, Stone game $version</a>";
    echo "
    ";
    
    
    echo "[/size]";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    
    
    function echo_scores($pscore,$cscore,$pchoice,$cchoice,$wld){
    
        global $player,$player_width,$player_height,$comp,$comp_width,$comp_height,$fontface;
    
        if ($wld == "won"){
            $text = "You chose $pchoice. The computer chose $cchoice. You won.";
        }
        if ($wld == "lost"){
            $text = "You chose $pchoice. The computer chose $cchoice. You lost.";
        }
        if ($wld == "drew"){
            $text = "You chose $pchoice. So did the computer. You drew.";
        }
    
        echo "<table width=&#39;100%&#39; border=&#39;0&#39; cellpadding=&#39;1&#39; cellspacing=&#39;1&#39;><tr><td width=&#39;50%&#39; align=&#39;center&#39;><img src=&#39;$player&#39; width=&#39;$player_width&#39; height=&#39;$player_height&#39;><font face=&#39;$fontface&#39; size=&#39;6&#39;>[b]$pscore[/b]</font></td><td width=&#39;50%&#39; align=&#39;center&#39;><font face=&#39;$fontface&#39; size=&#39;6&#39;>[b]$cscore[/b]</font><img src=&#39;$comp&#39; width=&#39;$comp_width&#39; height=&#39;$comp_height&#39;></td></tr><tr><td align=&#39;center&#39; colspan=&#39;2&#39;><font face=&#39;$fontface&#39; size=&#39;3&#39;>$text</td></tr></table>";
    
        return;
    }
    
    ?>
    Want something coded email me at sales@webnwaphost.com for a prices.




    Comment


      #3
      oh thanks i dint know that someone answer this one! but i already fixed it... thanks anyway

      Comment


        #4
        no probs
        Want something coded email me at sales@webnwaphost.com for a prices.




        Comment

        Working...
        X