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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -