Hello everyone. I'm trying to compare 2 things to determine if it's true. I have a variable called "StrandName". The value of "StrandName" is entered by the user through a textbox.
I am trying to say:
if($StrandName == 'agriculture'){
// then do a bunch of stuff
}
Even when I type agriculture in it doesn't go in the "if-Statement". This is my code:
<table border="0" cellpadding="0" cellspacing="2" width="180">
<tr>
<td>
<form name="formSearch" action="content.php?section=results" method="POST">
<B><font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Strand:</font> </B><BR>
</td>
<td><input type="text" name="strandNum" size="25" maxlength="50"></td>
<td></td>
</tr>
// the following code is within another function.
}elseif($strandNum AND !$teacherName AND !$location){
print"<h3>Results for: $strandNum</h3>";
$strandNum ='%' .$strandNum.'%';
$sql="SELECT teachers.*
from teachers
ORDER BY '$orderBy'";
}
if(!$strandNum){ // it will go here
printRecord();
}elseif(strandNum){ // it will get here
$NewStrand=$totalStrand; // it will get here
if($strandNum== 'agriculture'){ //never here
print"<td>hello</td>";
}
Can anyone see what's wrong?