I have a form where the user can simpy enter the field they want to query and it takes them to an update page.

In that page I define the variable as follows:

<?php
$tcode="$_POST[teamID]";
?> 

Then in various places I can use $tcode to insert the result from the user post. It works fine until I get to this IF statement:

    echo "</td><td width='60' bgcolor='CCCCCC' valign='center' align='center'><font face='arial' size='1' color='CC0000'><b>";
    if ($row[''.$w.'W']=="$tcode") echo "<img src='/fantasy/images/bar_active.png' width='60' height='12'><br>";
    echo "&nbsp";

I know it is the syntax after the ==, as this works fine...

    echo "</td><td width='60' bgcolor='CCCCCC' valign='center' align='center'><font face='arial' size='1' color='CC0000'><b>";
    if ($row[''.$w.'W']=="BEARS") echo "<img src='/fantasy/images/bar_active.png' width='60' height='12'><br>";
    echo "&nbsp";

(BEARS would eqaul the user post). Any thoughts on how to make the IF == statement work?

hi,

I don't understand this

<?php
$tcode="$_POST[teamID]";
?> 

If my suspicion is correct, then it should be coded as something like this.

<?php

$tcode = $_POST['teamID'];

?> 
commented: That's probably the answer. +2
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.