0

Hello

I have a form with a textfield simply named 'textfield' on one page and a table with a recordset on another page. It has a dynamic field/text with this code

SELECT codas
FROM t
WHERE user = colname

and colname is

$_POST['textfield']

I manually replace colname with a user I have in my BD and it works perfectly. I tried switching the form on the first page to GET but it doesnt let me as it seems the wizard for login user doesnt allow me. Im kinda stuck and lost so if someone could help me, thanks.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by ko ko
0

Your post isn't too clear. If POST works, then why are you changing it to GET?

Can you include your html form as this would make things clearer?

<form name="user" action="page.php" method="POST">
    <input type="text" name="textfield">
    <input type="submit" name="sub" value="Login">
</form>
<?php 

if(isset($_POST['sub']))
{
    if(isset($_POST['textfield']))
    {
        $q = mysql_query("SELECT codas FROM t WHERE user = '$_POST['textfield']'") or die(mysql_error());
    }
    else
    {
        echo "can't retrieve the form value";
    }
}

?>
0

$_POST['textfield'] for post method and $_GET['textfield'] for get method.
Isn't what you want ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.