jdimino Posted July 13, 2009 Share Posted July 13, 2009 Hi Everyone Hope someone can help me, I would like to know how to make the following links work in this script. <a href="http://Mysite/SEArchive/approve.php?id=' . $row['id'] . '">Approve</a> <a href="http://Mysite/SEArchive/deny.php?id=' . $row['id'] . '">Deny</a> <?PHP function alert($alert) { $out .='<script type="text/javascript"> alert("'.$alert.'"); </script> '; print $out; } $imgpath="http://Mysite/SEArchive/"; mysql_connect("localhost", "xxxx_xxxx", "xxxx") or die(mysql_error()); mysql_select_db("xxxx_xx") or die(mysql_error()); $sql = "SELECT * FROM `ihsreg` WHERE approve!='TRUE' ORDER BY `Bloom_Name` ASC"; $results = mysql_query($sql); $column = 1; echo "<table>"; while(($row = mysql_fetch_assoc($results)) !== false) { $bloom=trim(ucwords($row['Bloom_Name'])); $id=trim(ucwords($row['id'])); $path=substr($bloom,0,1)."/"; if ($column == 1) { print "<tr>"; } echo ' <td> <a href="http://Mysite/SEArchive/RegPending1.php?search=' . $row['Bloom_Name'] . '"> <img src="'.$imgpath.$path.$bloom.'.jpg" width="130" height="130" border="0"> <BR></a>' .$bloom.'</td>';<BR> <a href="http://Mysite/SEArchive/approve.php?id=' . $row['id'] . '">Approve</a> <a href="http://Mysite/SEArchive/deny.php?id=' . $row['id'] . '">Deny</a> if ($column == 6) { echo "</tr>"; $column = 0; } $column++; } if ($column < 5) { while ($column < 5) { $column++; echo " <td> </td>"; } echo "</tr>"; } echo "</table>"; ?> Link to comment https://forums.phpfreaks.com/topic/165787-links-help/ Share on other sites More sharing options...
Asheeown Posted July 13, 2009 Share Posted July 13, 2009 On the approve.php or deny.php you'll have a URL variable called "id" Call it like this: <?php $Id = $_GET['id']; ?> Now the variable $Id holds the id for whatever you are doing you can use it in a mysql query to set an approve or deny flag in the database. Link to comment https://forums.phpfreaks.com/topic/165787-links-help/#findComment-874672 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.