|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: |
<!-- INCLUDE overall_header.html -->
<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p>
<!-- IF U_MCP --><p>{CURRENT_TIME} <br />[ <a href="{U_MCP}">{L_MCP}</a> ]</p><!-- ELSEIF S_USER_LOGGED_IN --><p>{CURRENT_TIME}</p><!-- ENDIF -->
<html>
<head>
<?php
$Dir = './images/';
mysql_connect('localhost', 'xxx', 'xxx');
mysql_select_db('pets');
$arr_hdd_files = array();
$arr_db_files = array();
$arr_insert_files = array();
//get files in db
$query = "SELECT * FROM image";
$result = mysql_query($query) or die("Could not execute query ".mysql_error());
$row_result = mysql_fetch_assoc($result);
if($row_result) {
do {
$arr_db_files[] = $row_result['name'];
} while($row_result = mysql_fetch_assoc($result));
}
//check files on disk
foreach (glob("$Dir/*.{jpg,gif,png}", GLOB_BRACE) as $filename) {
$pathinfo = pathinfo($filename);
$name = basename($filename);
$ext = $pathinfo['extension'];
$arr_hdd_files[] = $name;
$size = filesize($filename);
$thePath=dirname($_SERVER['PHP_SELF']) . substr($filename, 1);
//check hdd filename against array of db filenames
if ( !in_array($name,$arr_db_files) ) {
$query1 = "INSERT INTO image SET name='$name', size='$size', type='$ext', path='$thePath'";
// or uncomment to use blob
// $blob = addslashes(file_get_contents($filename));
// $query = "INSERT INTO images SET name='$name', size='$size', type='$ext', content='$blob'";
$result1 = mysql_query($query1);
if($result) {
$arr_insert_files[] = $name;
}
}
}
//show results
echo "<h2>Results</h2>\n";
echo '<p>Files on Disk</p><ul>';
if(!empty($arr_hdd_files)) {
foreach($arr_hdd_files as $k => $v) {
echo '<div class="panel">
<"<li>$v</li>"></div>';
}
echo '</ul>';
} else {
echo '<li>None</li></ul>';
}
echo '<p>Files in Database</p><ul>';
if(!empty($arr_db_files)) {
foreach($arr_db_files as $k => $v) {
echo "<li>$v</li>";
}
echo '</ul>';
} else {
echo '<li>None</li></ul>';
}
echo '<p>Files inserted to DB</p><ul>';
if(!empty($arr_insert_files)) {
foreach($arr_insert_files as $k => $v) {
echo "<li>$v</li>";
}
echo '</ul>';
} else {
echo '<li>None</li></ul>';
}
?>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h1>Files on Disk</h1>
echo "<li>$v</li>";
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE overall_footer.html -->
|
Advertisement
| Hall of Fame |