Categories > TinyButStrong general >

$_POST Variables Being Shown as String

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: StudioX
Date: 2005-07-01
Time: 05:13

$_POST Variables Being Shown as String

I have a form with the following code:

        [onload;file='templates/default/site/header.tpl.php']
        <h1>[var.pagetitle]</h1>
        <p class="subtitle">[var.pagesubtitle]</p>
        <!-- BEGIN LOGIN FORM -->
        <div class="tablecontainer">
            <form action="[var..script_name]" method="post" name="frm_login" id="frm_login">
            <input type="hidden" id="clicked" name="clicked" value="1" />
            <table cellspacing="1" cellpadding="3" summary="">
                <tr>
                    <td class="shaded">[var.login.username]</td>
                    <td class="basic">
                        <input type="text" name="username" id="username" class="textbox" style="width:200px;" value="<?php $_POST['username'];?>" />
                    </td>
                </tr>
                <tr>
                    <td class="shaded">[var.login.password]</td>
                    <td class="basic">
                        <input type="password" name="password" id="password" class="textbox" style="width:200px;" value="<?php $_POST['password'];?>" />
                    </td>
                </tr>
                <tr>
                    <td class="shaded">
                        &nbsp;
                    </td>
                    <td class="basic">
                        <input type="submit" class="button" value="[var.buttonlogin]" />
                    </td>
                </tr>
            </table>
            </form>
        </div>
        <!-- END LOGIN FORM -->
        [onload;file='templates/default/site/footer.tpl.php']

What is happening that on the page refresh, it briefly shows "<?php $_POST['password'];?>" in the textbox before displaying the actual value of the $_POST data.

Try it at http://studio-x.homedns.org/admin.php entering any data into the username and password textboxes.

Am I doing something wrong, or is this a glitch?
By: StudioX
Date: 2005-07-01
Time: 05:25

Re: $_POST Variables Being Shown as String

Apologies. I found the answer by searching through other threads.