if ($i == 1) { $destination = "archive/{$list}/{$mailid}/index.html"; } else { $destination = "archive/{$list}/{$mailid}/" . $HTTP_POST_FILES['userfile']['name'][$i]; $query = "insert into images values ({$mailid}, \n '" . $HTTP_POST_FILES['userfile']['name'][$i] . "',\n '" . $HTTP_POST_FILES['userfile']['type'][$i] . "')"; $result = mysql_query($query); } } //if we are using PHP version >= 4.03 if (!is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'][$i])) { // possible file upload attack detected echo 'Something funny happening with ' . $HTTP_POST_FILES['userfile']['name'] . ', not uploading.'; do_html_footer(); exit; } move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'][$i], $destination); /* // if version <= 4.02 copy ($userfile[$i], $destination); unlink($userfile[$i]); */ $i++; } display_preview_button($list, $mailid, 'preview-html'); display_preview_button($list, $mailid, 'preview-text'); display_button('send', "&id={$mailid}"); echo '<br /><br /><br /><br /><br />'; do_html_footer(); ?>
function display_items($title, $list, $action1 = '', $action2 = '', $action3 = '') { global $table_width; echo "<table width = {$table_width} cellspacing = 0 cellpadding = 0 \n border = 0>"; // count number of actions $actions = ($action1 != '') + ($action2 != '') + ($action3 != ''); echo '<tr> <th colspan = ' . (1 + $actions) . " bgcolor='#5B69A6'> {$title} </th>\n </tr>"; // count number of items $items = sizeof($list); if ($items == 0) { echo '<tr> <td colspan = ' . (1 + $actions) . 'align = center>No Items to Display</td> </tr>'; } else { // print each row for ($i = 0; $i < $items; $i++) { if ($i % 2) { // background colors alternate $bgcolor = "'#ffffff'"; } else { $bgcolor = "'#ccccff'"; } echo "<tr>\n <td bgcolor = {$bgcolor} \n width = " . ($table_width - $actions * 149) . '>'; echo $list[$i][1]; if ($list[$i][2]) { echo ' - ' . $list[$i][2]; } echo '</td>'; // create buttons for up to three actions per line for ($j = 1; $j <= 3; $j++) { $var = 'action' . $j; if (${$var}) { echo "<td bgcolor = {$bgcolor} width = 149>"; // view/preview buttons are a special case as they link to a file if (${$var} == 'preview-html' || ${$var} == 'view-html' || ${$var} == 'preview-text' || ${$var} == 'view-text') { display_preview_button($list[$i][3], $list[$i][0], ${$var}); } else { display_button(${$var}, '&id=' . $list[$i][0]); } echo '</td>'; } } echo "</tr>\n"; } echo '</table>'; } }
function display_items($title, $list, $action1 = '', $action2 = '', $action3 = '') { global $table_width; echo "<table width=\"{$table_width}\" cellspacing=\"0\" cellpadding=\"0\"\n border=\"0\">"; // count number of actions $actions = ($action1 != '') + ($action2 != '') + ($action3 != ''); echo "<tr>\n <th colspan=\"" . (1 + $actions) . "\" bgcolor=\"#5B69A6\">" . $title . "</th>\n </tr>"; // count number of items $items = sizeof($list); if ($items == 0) { echo "<tr>\n <td colspan=\"" . (1 + $actions) . "\" align=\"center\">No Items to Display</td>\n </tr>"; } else { // print each row for ($i = 0; $i < $items; $i++) { if ($i % 2) { // background colors alternate $bgcolor = "#ffffff"; } else { $bgcolor = "#ccccff"; } echo "<tr>\n <td bgcolor=\"" . $bgcolor . "\"\n width=\"" . ($table_width - $actions * 149) . "\">"; echo $list[$i][1]; if (@$list[$i][2]) { echo " - " . $list[$i][2]; } echo "</td>"; // create buttons for up to three actions per line for ($j = 1; $j <= 3; $j++) { $var = "action" . $j; if (${$var}) { echo "<td bgcolor=\"" . $bgcolor . "\" width=\"149\">"; // view/preview buttons are a special case as they link to a file if (${$var} == 'preview-html' || ${$var} == 'view-html' || ${$var} == 'preview-text' || ${$var} == 'view-text') { display_preview_button($list[$i][3], $list[$i][0], ${$var}); } else { display_button(${$var}, '&id=' . $list[$i][0]); } echo "</td>"; } } echo "</tr>\n"; } echo "</table>"; } }