Get information from an HTML tag and pass it to PHP -
so here thing. need to call php page link (<a href='name.php'>
) access database , print information specific links. think code more clear question:
<?php session_start(); //start session capture usrname processlogin.php $usrname=$_session['usrname']; $query = "select est_name students usrname=".$usrname."; $result = $db->query($query); while( $row = mysqli_fetch_array(($result))) { echo "<a href="showprofile.php">".$row['est_name']."</a>"; //i need click here , show information in database //for specific student } ?>
my question is: there way name specific link can use information want specific student?
change link tag provide id in query parameters.
echo "<a href=\"showprofile.php?id={$row['id']}\">{$row['est_name']}</a>"; // link <a href="showprofile.php?id=123">some name</a>
then can access in showprofile.php
script using $_get
$student_id = $_get['id']; // $student_id 123
Comments
Post a Comment