Autor | Zpráva | ||
---|---|---|---|
danny98 Profil |
#1 · Zasláno: 10. 7. 2016, 19:18:25
ahoj, můžete mi prosím pomoc abych to udělal správně, nevím jak to udělat.
zde mám kód: <?php $where = ""; if ($genre && $genre != "vse") { $where .= "WHERE `genre` = '" . mysql_real_escape_string($genre) . "'"; } if ($country && $country != "vse") { $where .= (!empty($where) ? " AND " : " WHERE "); $where .= "`country` = '" . mysql_real_escape_string($country) . "'"; } echo "<table class='hot5'>"; echo "<tr>"; echo "<td><h4><b><?php $translate->__('Name'); ?></b></h4></td>"; echo "<td><h4><b><?php $translate->__('Genre'); ?></b></h4></td>"; echo "<td><h4><b><?php $translate->__('Country'); ?></b></h4></td>"; echo "</tr>"; $sql = "SELECT * FROM `stations` $where"; $result = mysql_query($sql); $value = $p['id']; while ($p = mysql_fetch_assoc($result)) { echo '<tr><td><a href = "details.php?id=' . $p['id'] . '">' . $p['station'] . '</a></td><td>' . $p['genre'] . '</td><td>' . $p['country'] . '</td></tr>'; } echo "</table>"; mysql_free_result($result); if(empty($country) AND empty($genre) AND empty($_COOKIE["country2"]) AND empty($_POST["station name"])){ echo"<h4>Choose parameters to search</h4>"; } if (empty($country) AND !empty($_COOKIE["country2"])) { echo "<table class='hot5'>"; echo "<tr>"; echo "<td><h4><b><?php $translate->__('Name'); ?></b></h4></td>"; echo "<td><h4><b><?php $translate->__('Genre'); ?></b></h4></td>"; echo "<td><h4><b><?php $translate->__('Country'); ?></b></h4></td>"; echo "</tr>"; $sql = "SELECT * FROM `stations` WHERE `country` = '" . mysql_real_escape_string($_COOKIE["country2"]) . "'"; $result = mysql_query($sql); $value = $p['id']; while ($p = mysql_fetch_assoc($result)) { echo '<tr><td><a href = "details.php?id=' . $p['id'] . '">' . $p['station'] . '</a></td><td>' . $p['genre'] . '</td><td>' . $p['country'] . '</td></tr>'; } echo "</table>"; mysql_free_result($result); } |
||
danny98 Profil |
#2 · Zasláno: 10. 7. 2016, 21:11:26
hotovo vyřešil jsem to přes defaultní cookie, která bude při processu nastavování webu smazána.
zde je link: radiodb.tk/search.php |
||
Časová prodleva: 8 let
|
0