My results will sometimes produce duplicate extensions for the images displayed for the field "Link".
Our images are stored with CPC as the image extension not JPG. Every so often I get the result as .cpc.cpc and not just the regular .cpc
I looked in the database and they are stored as only .cpc. Any ideas why my results would sometimes produce a duplicated extension??
Just so you know key1 is the ID of the person and key2 is the booking number.
The links are stored in this format m:/Cop100/25860/113527.cpc
EXAMPLE OF DUPLICATED RESULT:
file:///m:/Cop100/25860/113527.cpc.cpc
Should have been:
file:///m:/Cop100/25860/113527.cpc
<?php
$server_choice = $_GET['db'];
$username="root";
$password="";
$database="CPCImage";
$IP = $_SERVER['REMOTE_ADDR'];
$logdetails= date("F j, Y, g:i a");
// Search Criteria
$db_ans_name=$_POST['ans_name'];
$db_ans_Key1=$_POST['ans_Key1'];
$db_ans_race=$_POST['ans_race'];
$db_ans_sex=$_POST['ans_sex'];
$db_ans_limit=$_POST['ans_limit'];
$db_ans_eyes=$_POST['ans_eyes'];
$db_ans_hair=$_POST['ans_hair'];
$db_ans_age_low=$_POST['ans_age_low'];
$db_ans_age_high=$_POST['ans_age_high'];
$db_ans_weight_low=$_POST['ans_weight_low'];
$db_ans_weight_high=$_POST['ans_weight_high'];
$db_ans_height_low=$_POST['ans_height_low'];
$db_ans_height_high=$_POST['ans_height_high'];
$db_ans_BookDate=$_POST['ans_BookDate'];
// Search Criteria
// Create a log file
include ('log.php');
// Create a log file
// Change if you want to go live or use test DB
$serverloc="10.10.100.12";
//$serverloc="localhost";
mysql_connect($serverloc,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT Key1, MAX(Key2), Name, Sex, Race, DOB, Age, Eyes, Hair, Height, Weight, BookDate, City, State, Link, MugDate, Locker
FROM axhostdata
WHERE locker<>'0' AND key1 like '%".$db_ans_Key1."%' AND name like '%".$db_ans_name."%' AND sex like '%".$db_ans_sex."%' AND race like '%".$db_ans_race."%' AND eyes like '%".$db_ans_eyes."%' AND hair like '%".$db_ans_hair."%' AND BookDate like '%".$db_ans_BookDate."%' AND age BETWEEN '$db_ans_age_low' AND '$db_ans_age_high' and weight BETWEEN '$db_ans_weight_low' AND '$db_ans_weight_high' and height BETWEEN '$db_ans_height_low' AND '$db_ans_height_high'
GROUP BY Key1 ORDER BY Key2 DESC LIMIT 0,$db_ans_limit";
$result=mysql_query($query);
if ( $result > 0 ) {
$num=mysql_numrows($result);
} else {
echo " ";
}
mysql_close();
echo "<table>";
echo "<tr>";
echo "<td>";
echo '<img src = "logo.jpg"><br />';
echo "</td>";
echo "<td>";
echo "<font color=blue size=5> Mugshot Search Results</font><br>";
echo "Server: $serverloc<br>";
echo "Report Run By: $IP on $logdetails<br>";
echo "Report Date: $logdetails<br>";
echo '<a href="javascript:window.print()">Print Results</a>';
echo "</td>";
echo "</tr>";
echo "</table>";
$i=0;
while ($i < $num) {
$key1=mysql_result($result,$i,"key1");
$name=mysql_result($result,$i,"name");
$sex=mysql_result($result,$i,"sex");
$race=mysql_result($result,$i,"race");
$weight=mysql_result($result,$i,"weight");
$height=mysql_result($result,$i,"height");
$hair=mysql_result($result,$i,"hair");
$eyes=mysql_result($result,$i,"eyes");
$age=mysql_result($result,$i,"age");
$MugDate=mysql_result($result,$i,"mugdate");
$DOB=mysql_result($result,$i,"DOB");
$City=mysql_result($result,$i,"City");
$State=mysql_result($result,$i,"State");
$Locker=mysql_result($result,$i,"Locker");
$BookDate=mysql_result($result,$i,"BookDate");
$Link=mysql_result($result,$i,"Link");
echo "<table>";
echo "<tr>";
echo "<td>";
echo '<a href="file:///'.$Link.'" target="_blank"><img src="file:///'.$Link.'" alt="" title="" width="320" height="240"/>';
echo "</td>";
echo "<td>";
echo "<b>$name $sex / $race </b><br>";
echo "LEMS ID: <b>$key1</b><br>";
echo "DOB: $DOB Age: $age<br>";
echo "Weight: $weight Height: $height<br>";
echo "Hair: $hair Eyes: $eyes<br>";
echo "$City, $State<br><br>";
echo "<br>MugDate: $MugDate BookDate: $BookDate<br>";
echo "</td>";
echo "</tr>";
echo "</table>";
$i++;
}
?>