Jump to content

How would i if statement this?


Lee-Bartlett

Recommended Posts

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

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


?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.