Hi everyone
I'm in a desperate situation, I hope someone can help.
I have a search engine that use a mysql database and display 6 different images as a result.
The problem I’m having is, that all of the images are located in one folder, now I’m having a problem to see all files through my ftp program since I’ve exceeded the amount of files allowed by my host, so I am forced to split the folder by adding 26 subdirectories (A-Z) to SEArchive directory and move all images that start with the letter “A” to the a subdirectory http://www.mysite/SEArchive/a , the same with “B” “C” etc….
Is there a php or a function code I can add so that it will search through all 26 subdirectories until it finds the image.
I added the codes in red and now uploads from the subdirectory, however when I try the cvdata1.php it adds the subdirectory path. example: a/Adam it should just Adam
I would appriciate if you add the code to the script, since I'm only a novice and have a lot to learn.
PHP Code:<?PHP
function loadMember($name){
global $link;
// Fetch total number of records
//$SQL="SELECT * FROM ihsreg WHERE Bloom_Name ='".addslashes($name)."'";
if(stristr($name,"'") && !stristr($name,"\'")){
$name = addslashes($name);
}
$SQL="SELECT * FROM ihsreg WHERE Bloom_Name ='".$name."'";
$result = mysql_query($SQL);
$row = mysql_fetch_assoc($result);
[COLOR="Red"] $row['Bloom_Label']=$row['Bloom_Name'];
$row['Bloom_Name']=strtoupper($row['Bloom_Name'][0]) . '/' . $row['Bloom_Name'];[/COLOR] if($row['id'] != 1 && sizeof($row) > 5){
return $row;
} else {
$row = array('id'=>1,'Bloom_Name'=>'Unknown');
return $row;
}
}
function displayImageLink($member, $size = array(80,80)){
if($member['Bloom_Name']!='Unknown'){
$return = '<a href="javascript:show_remote(\''.addslashes($member['Bloom_Name']).'.jpg\');">';
$return .= '<img width="'.$size[0].'"
src="http://www.mysite/SEArchive/'.$member['Bloom_Name'].'.jpg" height="'.$size[1].'" border="0" \></a>';
} else {
$return .= '<img width="'.$size[0].'" src="http://www.mysite/SEArchive/U/Unknown.jpg" height="'.$size[1].'" \>';
}
return $return;
}
function loadMother($child){
return loadMember($child['Pod_Name']);
}
function loadFather($child){
return loadMember($child['Pollen_Name']);
}
if(isset($_REQUEST['Search_box'])){
$search = $_REQUEST['Search_box'];
$link = mysql_connect('localhost', 'xxxx', 'xxxx');
if (!$link) { die('Could not connect: ' . mysql_error()); }
mysql_select_db('xxxxx');
$main = loadMember($search);
$mother = loadMember($main['Pod_Name']);
$father = loadMember($main['Pollen_Name']);
$grandmother1 = loadMother($father);
$grandfather1 = loadFather($father);
$grandmother2 = loadMother($mother);
$grandfather2 = loadFather($mother);
$greatgrandmother1 = loadMother($grandfather1);
$greatgrandfather1 = loadFather($grandfather1);
$greatgrandmother2 = loadMother($grandmother1);
$greatgrandfather2 = loadFather($grandmother1);
$greatgrandmother3 = loadMother($grandfather2);
$greatgrandfather3 = loadFather($grandfather2);
$greatgrandmother4 = loadMother($grandmother2);
$greatgrandfather4 = loadFather($grandmother2);
//echo "<PRE>".print_r($grandmother2,true)."</PRE>";
}
?>Code:<script type="text/javascript"> <!-- function show_remote(imageSrc){ OpenWindow = window.open("cvdata1.php?search="+imageSrc.substring(0,imageSrc.length-4)+"", "remoteWin", "resizable=1, scrollbars=1, toolbar=1, left=0, top=0, width=800, height=390"); /*OpenWindow.document.write('<img width="250" height="250" src="'+imageSrc+'"><br>'); OpenWindow.document.write('<div align="center"><strong>'+imageSrc.split('.')[0]+'</strong><br>'); OpenWindow.document.write('<a href="javascript:window.close();">Close Window</a></div>'); */ } //--> </script>



Reply With Quote


Bookmarks