Thread: php wml

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    10
    Rep Power
    0

    php wml postgresql


    Hi.

    I am trying to send two variables from login.wml to auth.php.
    But auth.php gets empty variables.

    here is the code for login.wml:


    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
    <wml>
    <card newcontext="true" title="Fuhrpark Login" id="login">
    <p>
    <fieldset title="name &amp; PIN">
    Name:
    <input name="name"
    type="text"/><br/>
    Password:
    <input name="pin"
    type="password"/>
    </fieldset>
    <anchor>
    Login
    <go method="post" href="auth.php" >
    <postfield name="name" value="$nameeingeben"/>
    <postfield name="pin" value="$pineingeben"/>
    </go>
    </anchor>
    <do type="accept"
    label="Login">
    <go method="post" href="auth.php" >
    <postfield name="name" value="$nameeingeben"/>
    <postfield name="pin" value="$pineingeben"/>
    </go>
    </do>
    </p>
    </card>
    </wml>

    and here is the code for auth.php:

    <?php
    echo ("Name $name");
    echo ("Pin $pin");
    ?>

    What do i wrong?
    Please can you help me?
    Last edited by asvur; July 22nd, 2003 at 02:17 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Paris, France
    Posts
    375
    Rep Power
    12
    try

    PHP Code:

    <go method="post" href="auth.php" 
    <
    postfield name="name" value="$name"/> 
    <
    postfield name="pin" value="$pin"/> 
    </
    go
    To retreive data as variable
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    10
    Rep Power
    0
    i tried it but did not work.
    any idea
    Last edited by asvur; July 22nd, 2003 at 03:45 AM.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Paris, France
    Posts
    375
    Rep Power
    12
    You write that

    <anchor>
    Login
    <go method="post" href="auth.php" >
    <postfield name="name" value="$nameeingeben"/>
    <postfield name="pin" value="$pineingeben"/>
    </go>
    </anchor>
    <do type="accept"
    label="Login">
    <go method="post" href="auth.php" >
    <postfield name="name" value="$nameeingeben"/>
    <postfield name="pin" value="$pineingeben"/>
    </go>
    </do>

    Change the do and the anchor to use variable
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    10
    Rep Power
    0
    i have tried it now but it does not work.
    Last edited by asvur; July 22nd, 2003 at 08:53 AM.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Copenhagen, DK
    Posts
    231
    Rep Power
    14
    This is working for me:

    <?php
    header("Content-type: text/vnd.wap.wml");
    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
    . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    ?>
    <wml>
    <card id="main" title="Log ind">
    <p>
    Username:
    <br />
    <input title="user" name="username" />
    Password:
    <br /><input title="pass" name="password" type="password" />
    <anchor>
    Login
    <go href="check.wml" method="post">
    <postfield name="username" value="$(username)"/>
    <postfield name="password" value="$(password)"/>
    </go>
    </anchor>
    </p>
    </card>
    </wml>

    Then, check.wml:

    <?php
    header("Content-type: text/vnd.wap.wml");
    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
    . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    ?>
    <wml>
    <card id="varcheck" title="VARS">
    <p>
    <?php
    if(isset($_POST["username"])) {
    echo $_POST["username"];
    }
    echo"<br/>";

    if(isset($_POST["password"])) {
    echo $_POST["password"];
    }
    ?>
    </p>
    </card>
    </wml>

    But I'm new in the "wap-world", and I find it a bit complicated, making it all working together! :O)
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Switzerland
    Posts
    13
    Rep Power
    0

    Re: php wml postgresql


    Originally posted by asvur

    and here is the code for auth.php:

    <?php
    echo ("Name $name");
    echo ("Pin $pin");
    ?>

    What do i wrong?
    Please can you help me?
    try to access your POSTed variables with $_POST["your_variables_name"], for example $_POST["name"] and $_POST["pin"], maybe that'll do it. If it does, read the configuration chapter of the php documentation to know why, and maybe how to remove the feature.

IMN logo majestic logo threadwatch logo seochat tools logo