Lee-Bartlett Posted October 27, 2008 Share Posted October 27, 2008 Ok i would like to do this, if longitude and latitude have text in them then do the button, else echo no long lat entered. Here is my code, im just not sure how to work it in <? echo "<form method=post name=pop$id>"; echo "<tr><td>".$row['name']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['buissnes_name']."</td>"; echo "<td>".$row['location']."</td>"; echo "<td>".$row['latitude']."</td>"; echo "<td>".$row['longitude']."</td>"; echo "<td>".$row['type']."</td>"; echo "<form>"; echo "<td><input type=\"button\" onClick=\"openWindow$id(); return false;\" value=\"Pop Up Map\">"; (this is the button bit) echo "</td></tr>"; echo "</form>"; } ?> Link to comment https://forums.phpfreaks.com/topic/130335-how-would-i-if-statement-this/ Share on other sites More sharing options...
Fruct0se Posted October 27, 2008 Share Posted October 27, 2008 I think this is what you are trying to do <?php echo "<form method=post name=pop$id>"; echo "<tr><td>".$row['name']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['buissnes_name']."</td>"; echo "<td>".$row['location']."</td>"; echo "<td>".$row['latitude']."</td>"; echo "<td>".$row['longitude']."</td>"; echo "<td>".$row['type']."</td>"; echo "<form>"; if ($row['latitude'] and $row['longitude']) { echo "<td><input type=\"button\" onClick=\"openWindow$id(); return false;\" value=\"Pop Up Map\">"; } else { echo "<td>No Lat or Long entered"; } echo "</td></tr>"; echo "</form>"; ?> Link to comment https://forums.phpfreaks.com/topic/130335-how-would-i-if-statement-this/#findComment-675985 Share on other sites More sharing options...
Lee-Bartlett Posted October 27, 2008 Author Share Posted October 27, 2008 Unexpected end and i cant see what is missing. Link to comment https://forums.phpfreaks.com/topic/130335-how-would-i-if-statement-this/#findComment-676000 Share on other sites More sharing options...
dezkit Posted October 27, 2008 Share Posted October 27, 2008 You have a missing { somewhere in your code (Not the one you gave us.) Link to comment https://forums.phpfreaks.com/topic/130335-how-would-i-if-statement-this/#findComment-676004 Share on other sites More sharing options...
Lee-Bartlett Posted October 27, 2008 Author Share Posted October 27, 2008 ty found it i forgot to re add it bk in after accidentle delete:( Link to comment https://forums.phpfreaks.com/topic/130335-how-would-i-if-statement-this/#findComment-676010 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.