Below is my code where the link will be generated from database.. when user wanted to access the link they must be logged in.. how to make it?
And this is the code for the page that user needed to login to access this page.. this page is linked with the code at the top
Code:
<div class="h3"><?php echo $servername; ?> Features</div> <div class="mainbox"> <ul id="features"> <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("job_seeks", $con); $result = mysql_query("SELECT * FROM employer_user"); while($row = mysql_fetch_array($result)) { echo "<li><a href="."?page=job_detail".">".$row['business_name']."</a></li>"; } echo "</tbody>"; echo "</table>"; mysql_close($con); ?> </ul> </div>
Code:
<div class="h3"><?php echo $servername; ?> Features</div> <div class="mainbox"> <ul id="features"> <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("job_seeks", $con); $result = mysql_query("SELECT * FROM employer_user"); $row = mysql_fetch_array($result); ?> <table cellspacing=0 cellpadding=5> <tr><td class=listtitle colspan=2><center><span class='title2'></span></center></td></tr> <?php echo " <form method=\"POST\"> <tr><td class=list align=left><b>Username :</b></td><td class=list> ".$row['username']."<br></td></tr> <tr><td class=list align=left><b>Business Name :</b></td><td class=list> ".$row['business_name']."<br></td></tr> <tr><td class=list align=left><b>Address :</b></td><td class=list> ".$row['address']."<br></td></tr> <tr><td class=list align=left><b>Location :</b></td><td class=list> ".$row['location']."<br></td></tr> <tr><td class=list align=left><b>City/Town :</b></td><td class=list> ".$row['city_town']."<br></td></tr> <tr><td class=list align=left><b>Email :</b></td><td class=list> ".$row['email']."<br></td></tr> <tr><td class=list align=left><b>Phone Number :</b></td><td class=list> ".$row['phone']."<br></td></tr> <tr><td class=list align=left><b>Qualification :</b></td><td class=list> ".$row['qualification']."<br></td></tr> <tr><td class=list align=left><b>Salary :</b></td><td class=list> ".$row['salary']."<br></td></tr> <tr><td class=list align=left><b>Description :</b></td><td class=list> ".$row['company_description']."<br></td></tr>"; echo "</td></tr></table>"; echo "<p><center><input type=\"submit\" name=\"setting\" value=\"Apply\" onClick=\"parent.location='?page=account'\" /> </center>"; ?> </ul> </div>
Comment