Hi
I'm not sure if I had a previuos post in regard to this problem.
I would like to upload all images from individual subdirectory (a-z) according to the first letter of the image name.
How can I add a code to this paath
http://www.mysite/SEArchive/ to read from subdirectory. example: John.jpg path=
http://www.mysite/SEArchive/J th for Mary.jpg the sub would be "M" path=
http://www.mysite/SEArchive/M
I Hope you can help
[php]
<?PHP
$link = mysql_connect('localhost', 'xxx_xxx', 'xxx');
if (!$link) { die('Could not connect: ' . mysql_error()); }
mysql_select_db('xxx_xxx');
function find($name, $view){
global $link;
// Fetch total number of records
//$SQL="SELECT * FROM ihsreg WHERE Bloom_Name ='".addslashes($name)."'";
if(stristr($name,"'") && !stristr($name,"\'")){
$name = addslashes($name);
}
switch($view){
case "1": $column = 'Bloom_Name'; break;
case "2": $column = 'Pod_Name'; break;
case "3": $column = 'Pollen_Name'; break;
case "4": $column = 'Hybridiser'; break;
case "5": $column = 'Origin'; break;
default: $column = 'Bloom_Name'; break;
}
$SQL = "SELECT Bloom_Name, Pod_Name, Pollen_Name, Hybridiser, Origin " .
"FROM ihsreg " .
"WHERE " . $column . " LIKE '" . $name . "' AND $column != '' " .
"ORDER BY Bloom_Name ASC";
$result = mysql_query($SQL);
$results = array();
while($row = mysql_fetch_row($result)){
$results[] = $row;
}
return $results;
}
$noimagemessage = "No Photo Available";
if(isset($_GET['search'])){
//$fp = file('reg.txt');
//$search = "/".stripslashes($_GET['search'])."/i";
$search = $_GET['search'];
$y = 0;
$results[0]=Array();
$results[1]=Array();
$results[2]=Array();
$results[3]=Array();
$results[4]=Array();
//for($x=0; $x<count($fp); $x++){
/*
$search_text = "";
if($_GET['view']==5){
$search_text = split("\|",$fp[$x]);
$search_text = $search_text[4];
}else if($_GET['view']==4){
$search_text = split("\|",$fp[$x]);
$search_text = $search_text[3];
}else if($_GET['view']==3){
$search_text = split("\|",$fp[$x]);
$search_text = $search_text[2];
}else if($_GET['view']==2){
$search_text = split("\|",$fp[$x]);
$search_text = $search_text[1];
}else{
$search_text = split("\|",$fp[$x]);
$search_text = $search_text[0];
}
*/
$results = find($search,$_GET['view']);
/*
if(preg_match($search,$search_text)){
list($results[0][$y],$results[1][$y],$results[2][$y],$results[3][$y],$results[4][$y])=split("\|",$fp[$x]);
$y++;
}
*/
$y = sizeof($results);
//}
/*
if($_GET['view']==5){
array_multisort($results[4],$results[0],$results[1],$results[2],$results[3]);
}else if($_GET['view']==4){
array_multisort($results[3],$results[0],$results[1],$results[2],$results[4]);
}else if($_GET['view']==3){
array_multisort($results[2],$results[0],$results[1],$results[3],$results[4]);
}else if($_GET['view']==2){
array_multisort($results[1],$results[0],$results[2],$results[3],$results[4]);
}else{
array_multisort($results[0],$results[1],$results[2],$results[3],$results[4]);
}
*/
//echo '<PRE style="font-size: 9px;">';print_r($results);echo "</pre>";
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
img{
border:0;
}
</style>
<script type="text/javascript">
function open_win(img){
window.open("cvdata1.php?search="+img);
}
</script>
</head>
<body bgcolor="#FFFFFF" BACKGROUND="