<?php if(isset($_POST['c_id'])) { //input field value which contain Institution name $val=$_POST['c_id']; $sql="select RegistrationId from `students` where `Institution`='$val' "; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($result)){ $number=$row['RegistrationId']; ?> <a href='<?php echo "index.php?StudentID=$number"; ?>' target="index" id="link"> //getting student id in the dynamic link <?php echo "$number"; echo "<br/>"; }} ?> <div id="index" name="index"> </div> <div id="Documents"> </div> <script> $(document).on('change', 'a#link', function() { $.ajax({ url: 'Documents.php', type: 'get', success: function(html) { $('div#Documents').append(html); } }); }); </script>
<?php $link=$_GET['StudentID']; $sql = "select StudentName,Course,Age,Address from `students` where `RegistrationId`="."'".$link."'"; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo $row['StudentName']."<br/>"; echo $row['Course']."<br/>"; echo $row['Age']."<br/>"; echo $row['Address']."<br/>"; } ?>
$link=$_GET['StudentID']; $qry = "select Image,Marksheet from `documents` where `RegistrationId`='$link'"; $result = mysql_query($qry) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $image = $row["Image"]; $image1 = $row["Marksheet"]; echo '<embed src='. $image.'>'; echo ' <object data='. $image1.'width="750" height="600">'; echo ' </object>'; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)