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.

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";
    }
}

?>

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.