Viewing file: profile.php (4.05 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE html> <html>
<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> <title>Student Profile</title> <link rel="stylesheet" href="profile/assets/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=ABeeZee"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Muli"> <link rel="stylesheet" href="profile/assets/css/LinkedIn-like-Profile-Box.css"> <link rel="stylesheet" href="profile/assets/css/styles.css"> </head>
<body> <div class="text-center border rounded-0 shadow-sm profile-box" style="width: 200px;height: 300px;background-color: #ffffff;margin: 5px;"> <div style="height: 50px;background-image: url("assets/img/bg-pattern.png");background-color: rgba(54,162,177,0);"></div> <div><img class="rounded-circle" src="profile/assets/img/bg-cta.jpg" width="60px" height="60px" style="background-color: rgb(255,255,255);padding: 2px;"></div> <div style="height: 80px;"> <h4>YOUR PROFILE</h4> <p style="font-size: 12px;"> <?php include 'connect.php';?> <?php
// Get the search variable from URL
$var = 1 ;; $trimmed = trim($var); //trim whitespace from the stored variable
// rows to return $limit=10;
// check for an empty string and display a message. if ($trimmed == "") { exit; }
// check for a search parameter if (!isset($var)) { echo "<p>We dont seem to have a search parameter!</p>"; exit; }
// Build SQL Query $query = "select * from profile where userid='$user' "; // EDIT HERE and specify your table and field names for the SQL query
$numresults=mysql_query($query); $numrows=mysql_num_rows($numresults);
// If we have no results, offer a google search as an alternative
if ($numrows == 0) {
}
// next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; }
// get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query");
$sr=0; // begin to show results set $count = 1 + $s ; $amountss=0;
// now you can display the results returned while ($row= mysql_fetch_array($result)) {
echo "<table width=\"100%\" border=\"1\" cellspacing=\"2\" cellpadding=\"2\" bgcolor='#CCCCCC'>\n"; echo " <tr>\n"; echo " <td width=\"22%\">Name</td>\n"; echo " <td width=\"35%\">$row[student_name]</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td height=\"28\">Address</td>\n"; echo " <td>$row[address]</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>Mobile</td>\n"; echo " <td>$row[mobile]</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>Registration Date</td>\n"; echo " <td>$row[registration_date]</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>Expiry Date</td>\n"; echo " <td>$row[expiry_date]</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>USER ID</td>\n"; echo " <td>$row[userid]</td>\n"; echo " </tr>\n"; echo "</table>\n";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\" bgcolor='#FFFFFF'>\n"; echo "<tr height='20'>"; echo " <td> </td>\n"; echo " </tr>\n"; echo "</table>\n"; $count++ ; }
$currPage = (($s/$limit) + 1);
//break before paging echo "";
// next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print "<a href=\"$PHP_SELF?s=$prevs&q=$var\"><< Prev 10</a> "; }
// calculate number of pages needing links $pages=intval($numrows/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
?> </p> </div> </div> <script src="profile/assets/js/jquery.min.js"></script> <script src="profile/assets/bootstrap/js/bootstrap.min.js"></script> </body>
</html>
|