I am trying to link a image to a MYSQL variable.
I have user photos that i would like to link this page. So far I created an image upload and renamed the imaged to the username.jpg. Figured it would be easy to then link but nothing seems to be working.
Here is the total code..
Expand|Select|Wrap|Line Numbers
- <?php require_once('../Connections/JMI10.php'); ?><?php require_once('../Connections/JMI10.php'); ?><?php require_once('../Connections/JMI10.php'); ?>
- <?php
- if (!function_exists("GetSQLValueString")) {
- function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
- {
- if (PHP_VERSION < 6) {
- $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
- }
- $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
- switch ($theType) {
- case "text":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "long":
- case "int":
- $theValue = ($theValue != "") ? intval($theValue) : "NULL";
- break;
- case "double":
- $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
- break;
- case "date":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "defined":
- $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
- break;
- }
- return $theValue;
- }
- }
- if (!function_exists("GetSQLValueString")) {
- function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
- {
- if (PHP_VERSION < 6) {
- $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
- }
- $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
- switch ($theType) {
- case "text":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "long":
- case "int":
- $theValue = ($theValue != "") ? intval($theValue) : "NULL";
- break;
- case "double":
- $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
- break;
- case "date":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "defined":
- $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
- break;
- }
- return $theValue;
- }
- }
- if (!function_exists("GetSQLValueString")) {
- function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
- {
- if (PHP_VERSION < 6) {
- $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
- }
- $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
- switch ($theType) {
- case "text":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "long":
- case "int":
- $theValue = ($theValue != "") ? intval($theValue) : "NULL";
- break;
- case "double":
- $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
- break;
- case "date":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "defined":
- $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
- break;
- }
- return $theValue;
- }
- }
- $editFormAction = $_SERVER['PHP_SELF'];
- if (isset($_SERVER['QUERY_STRING'])) {
- $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
- }
- if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "useredit")) {
- $updateSQL = sprintf("UPDATE ``user`` SET username=%s WHERE userid=%s",
- GetSQLValueString($_POST['username'], "text"),
- GetSQLValueString($_POST['userid'], "text"));
- mysql_select_db($database_JMI10, $JMI10);
- $Result1 = mysql_query($updateSQL, $JMI10) or die(mysql_error());
- $updateGoTo = "master.php";
- if (isset($_SERVER['QUERY_STRING'])) {
- $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
- $updateGoTo .= $_SERVER['QUERY_STRING'];
- }
- header(sprintf("Location: %s", $updateGoTo));
- }
- mysql_select_db($database_JMI10, $JMI10);
- $query_rsshowuser = "SELECT * FROM `user`";
- $rsshowuser = mysql_query($query_rsshowuser, $JMI10) or die(mysql_error());
- $row_rsshowuser = mysql_fetch_assoc($rsshowuser);
- $totalRows_rsshowuser = mysql_num_rows($rsshowuser);
- $maxRows_DetailRS1 = 10;
- $pageNum_DetailRS1 = 0;
- if (isset($_GET['pageNum_DetailRS1'])) {
- $pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];
- }
- $startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;
- $colname_DetailRS1 = "-1";
- if (isset($_GET['recordID'])) {
- $colname_DetailRS1 = $_GET['recordID'];
- }
- mysql_select_db($database_JMI10, $JMI10);
- $query_DetailRS1 = sprintf("SELECT * FROM survey1 WHERE userid = %s", GetSQLValueString($colname_DetailRS1, "int"));
- $query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);
- $DetailRS1 = mysql_query($query_limit_DetailRS1, $JMI10) or die(mysql_error());
- $row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
- if (isset($_GET['totalRows_DetailRS1'])) {
- $totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];
- } else {
- $all_DetailRS1 = mysql_query($query_DetailRS1);
- $totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);
- }
- $totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;
- $maxRows_DetailRS2 = 50;
- $pageNum_DetailRS2 = 0;
- if (isset($_GET['pageNum_DetailRS2'])) {
- $pageNum_DetailRS2 = $_GET['pageNum_DetailRS2'];
- }
- $startRow_DetailRS2 = $pageNum_DetailRS2 * $maxRows_DetailRS2;
- $colname_DetailRS2 = "-1";
- if (isset($_GET['recordID'])) {
- $colname_DetailRS2 = $_GET['recordID'];
- }
- mysql_select_db($database_JMI10, $JMI10);
- $query_DetailRS2 = sprintf("SELECT * FROM `user` WHERE userid = %s ORDER BY `state` ASC", GetSQLValueString($colname_DetailRS2, "-1"));
- $query_limit_DetailRS2 = sprintf("%s LIMIT %d, %d", $query_DetailRS2, $startRow_DetailRS2, $maxRows_DetailRS2);
- $DetailRS2 = mysql_query($query_limit_DetailRS2, $JMI10) or die(mysql_error());
- $row_DetailRS2 = mysql_fetch_assoc($DetailRS2);
- if (isset($_GET['totalRows_DetailRS2'])) {
- $totalRows_DetailRS2 = $_GET['totalRows_DetailRS2'];
- } else {
- $all_DetailRS2 = mysql_query($query_DetailRS2);
- $totalRows_DetailRS2 = mysql_num_rows($all_DetailRS2);
- }
- $totalPages_DetailRS2 = ceil($totalRows_DetailRS2/$maxRows_DetailRS2)-1;
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Untitled Document</title>
- <style type="text/css">
- <!--
- .kk {
- color: #030303;
- }
- .style1 {color: #F00; font-weight: bold; }
- .ee {
- color: #030303;
- }
- .ee1 {
- color: #FFF;
- }
- .dd {color: #F00;
- }
- .dd {
- font-size: 12px;
- color: #FFF;
- }
- .ee2 {color: #030303;
- }
- .hh {
- text-align: left;
- font-weight: bold;
- }
- .jj {
- color: #FFF;
- text-align: center;
- font-weight: bold;
- }
- .kk {
- text-align: left;
- }
- .jj .jj {
- font-weight: bold;
- }
- .jj {
- font-weight: bold;
- }
- .jj {
- text-align: left;
- }
- .ll {
- font-weight: bold;
- }
- .kk {
- font-weight: bold;
- color: #030303;
- }
- .oo {
- font-weight: bold;
- font-size: 16px;
- }
- .hh {
- text-align: left;
- }
- .ll {
- font-family: Arial, Helvetica, sans-serif;
- }
- -->
- </style>
- </head>
- <body>
- <table width="701" border="0">
- <tr>
- <th width="532" valign="top" class="hh" scope="col"><p><span class="style1">Inspector Detail Page</span><span class="kk"></span></p>
- <p><a href="master.php">Inspector List</a> <a href="list.php">Admin Menu</a></p>
- <p class="ll"><?php echo $row_DetailRS2['firstname']; ?> <?php echo $row_DetailRS2['middlename']; ?> <?php echo $row_DetailRS2['lastname']; ?></p>
- <table width="453" height="58" border="1">
- <tr>
- <th width="82" bgcolor="#000080" class="jj" scope="col"><span class="kk" style="color: #FFF">Userid</span></th>
- <th width="144" class="hh" scope="col"><?php echo $row_DetailRS2['userid']; ?></th>
- <th width="76" bgcolor="#000080" class="jj" scope="col">Username </th>
- <th width="163" class="hh" scope="col"><?php echo $row_DetailRS2['username']; ?></th>
- </tr>
- <tr>
- <td bgcolor="#000080" class="jj">Status</td>
- <td class="hh"><?php echo $row_DetailRS2['usertype']; ?></td>
- <td bgcolor="#000080" class="jj">Password</td>
- <td class="hh"><?php echo $row_DetailRS2['password']; ?></td>
- </tr>
- </table></th>
- <th width="153" align="left" valign="middle" scope="col"><img src="http://bytes.com/topic/php/idphoto/nclark.jpg" width="157" height="232" /></th>
- </tr>
- </table>
- <table border="1" align="left">
- <tr>
- <td width="292" bgcolor="#DBDBDB" class="kk">Address1</td>
- <td width="338"><?php echo $row_DetailRS2['address1']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Address2</td>
- <td><?php echo $row_DetailRS2['address2']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">City</td>
- <td><?php echo $row_DetailRS2['city']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">County</td>
- <td><?php echo $row_DetailRS2['county']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">State</td>
- <td><?php echo $row_DetailRS2['state']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Zipcode</td>
- <td><?php echo $row_DetailRS2['zipcode']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Cell Phone</td>
- <td><?php echo $row_DetailRS2['cellphone']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Home Phone</td>
- <td><?php echo $row_DetailRS2['homephone']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Email Address</td>
- <td><?php echo $row_DetailRS2['email']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Home Territory</td>
- <td><?php echo $row_DetailRS2['hometerritory']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Remote Territory</td>
- <td><?php echo $row_DetailRS2['remoteterritory']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Previous Experience PErforming Inspections?</td>
- <td><?php echo $row_DetailRS2['experience']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">DIgital Camera Type:</td>
- <td><?php echo $row_DetailRS2['camera']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">List Experience</td>
- <td><?php echo $row_DetailRS2['experience2']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk"><span class="ee1" style="color: #030303">How many days are you willing to work per week?</span></td>
- <td><?php echo $row_DetailRS2['numberofdays']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Are you currently working full time?</td>
- <td><?php echo $row_DetailRS2['fulltime']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Are you available to work DAYTIME hours? </td>
- <td><?php echo $row_DetailRS2['daytime']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Internet Speed</td>
- <td><?php echo $row_DetailRS2['intenet']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Would You Be Willing To Obtain High Speed Internet?</td>
- <td><?php echo $row_DetailRS2['internet2']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Preffered Browser</td>
- <td><?php echo $row_DetailRS2['browser']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Operating System</td>
- <td><?php echo $row_DetailRS2['operatingsystem']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk"><span class="ee">How do you rate your computer knowledge?</span></td>
- <td><?php echo $row_DetailRS2['techknowledge']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">How many years have you been using a computer?</td>
- <td><?php echo $row_DetailRS2['techyears']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">A "URL" refers to which of the following</td>
- <td><?php echo $row_DetailRS2['techurl']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">When navigating a website, <br />
- what would you do to return to the last page viewed?</td>
- <td><?php echo $row_DetailRS2['technav']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Photo resolution refers to what?</td>
- <td><?php echo $row_DetailRS2['techcamres']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">The right button on the mouse <br />
- is used for the following tasks?</td>
- <td><?php echo $row_DetailRS2['techmouse']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Drivers License</td>
- <td><?php echo $row_DetailRS2['dl']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Accepted IC Agreement?</td>
- <td><?php echo $row_DetailRS2['icaccept']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Social Security Number</td>
- <td><?php echo $row_DetailRS2['ssnumber']; ?></td>
- </tr>
- <tr>
- <td bgcolor="#DBDBDB" class="kk">Birth Date</td>
- <td><?php echo $row_DetailRS2['birthdate']; ?></td>
- </tr>
- </table>
- </body>
- </html>
- <?php
- mysql_free_result($rsshowuser);
- mysql_free_result($DetailRS1);
- mysql_free_result($DetailRS2);
- ?>