0

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?

2
Contributors
1
Reply
19
Views
3 Years
Discussion Span
Last Post by veedeoo
1

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'];

?> 
Votes + Comments
That's probably the answer.
This question has already been answered. 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.