jiggens Posted October 1, 2007 Share Posted October 1, 2007 I am still new to PHP and was wondering how i would put in a specifc link to a pdf file on my page to show up under one set of data but not the other. <?php if (mysql_fetch_row(mysql_query("SELECT * from psh_communities WHERE status='Current' and area='San Diego'")) == "" || !$result) { print "<p>Coming Soon</p><p> </p>"; } else { print "<table border='0' cellspacing='0' cellpadding='5'>"; while($row = mysql_fetch_row($result)) { print "<tr><td valign='top' align='center'><a href='community.php?ID=" . $row[0] . "'><img src='../images/browse/logos/" . $row[0] . "-TH.jpg' alt='" . $row[1] . "' border='0' /></a></td>"; print "<td valign='top'><p><span class='comm-header-exception'>" . $row[1] . "</span><br />"; print $row[5] . "<br />"; print "<a href='community.php?ID=" . $row[0] . "'>View Details</a></p>"; print "</td></tr>"; } print "</table>"; } ?> Under view details i want to put another link for Self-Qual Form and the location is http://homes.pacificscene.com/browse/selfqualform/ and i just want to add it as hyperlink for community.php?ID=43 and no others. Could someone give me a hand on how to do this? Quote Link to comment https://forums.phpfreaks.com/topic/71420-solved-php-if-statement-for-specifc-criteria/ Share on other sites More sharing options...
pocobueno1388 Posted October 1, 2007 Share Posted October 1, 2007 Wherever you want it on that page, just put this code there: <?php if ($_GET['ID'] == 43){ //put link here } ?> Quote Link to comment https://forums.phpfreaks.com/topic/71420-solved-php-if-statement-for-specifc-criteria/#findComment-359503 Share on other sites More sharing options...
jiggens Posted October 1, 2007 Author Share Posted October 1, 2007 How is that going to only put it when the community ID 43 exists on the page, should i show you the rest of code on my page? Quote Link to comment https://forums.phpfreaks.com/topic/71420-solved-php-if-statement-for-specifc-criteria/#findComment-359524 Share on other sites More sharing options...
pocobueno1388 Posted October 1, 2007 Share Posted October 1, 2007 Well, the URL holds the community ID, right? Well...that code checks if the ID in the URL is equal to 43, and if it is, it will display the link. Have you tried it yet? Quote Link to comment https://forums.phpfreaks.com/topic/71420-solved-php-if-statement-for-specifc-criteria/#findComment-359536 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.