I am having problems getting this .php to run on my iis server. It runs ok on a webhost, i believe the code is not unix/windows compatible. I am running winXP and IIS5 with php 4.3.10 and mySQL 4.1.9.
Currently the code is having problems in the uploading a file section at the bottom of the segment of code here. A picture of the error can be viewed below... right click "copy shortcut" and paste it in a browser:
The picture of how it looks BEFORE I click create on directory is here:
http://members.tripod.com/blue_eyed_romeo/correct.gif
The picture of how it is AFTER I click create is here:
http://members.tripod.com/blue_eyed_romeo/error_after_click_create.gif
The picture of how it acts after I do the above and go back to the screen is here:
http://members.tripod.com/blue_eyed_romeo/error1.gif
The red error message sometimes will read:
"Error during read of "c:\inetpub\wwwroot\pics\galleries/c:\inetpub\wwwroot\pics\galleries/"
and after going to other menus and back... that will grow...
example
"c:\inetpub\wwwroot\pics\galleries/c:\inetpub\wwwroot\pics\galleries/c:\inetpub\wwwroot\pics\galleries/c:\inetpub\wwwroot\pics\galleries/".....and so on
This is a segment of the code...
<?php
/********************
********************/
session_start();
header("Cache-control: private");
define('IN_CBG', true);
require('include/functions.inc.php');
auth();
cb_html_header("test");
nav();
?>
<table align="center" width="600" cellspacing="1" cellpadding="0" class="maintable">
<tr>
<td class="tableh1"><h2>Manage Gallery Files</h2></td>
</tr>
<tr>
<td class="tableb">
<p><b>
</td>
</tr>
<tr>
<td align="center" class="tableh2"><br></td>
</tr>
</table>
<?php
$lang = 'en';
$homedir = './galleries';
$dirpermission = 0777;
$uploadedfilepermission = 0777;
$self = htmlentities(basename($_SERVER['PHP_SELF']));
$homedir = relpathtoabspath($homedir, getcwd());
$words = getWords($lang);
/ If PHP added any slashes, strip them /
if (ini_get('magic_quotes_gpc')) {
array_walk($GET, 'strip');
array_walk($POST, 'strip');
array_walk($_REQUEST, 'strip');
}
/ Return Images /
if (isset($GET['imageid'])) {
header('Content-Type: image/gif');
echo(getImage($GET['imageid']));
exit;
}
/ Initialize dirlisting output /
$error = $notice = '';
/ Set current directory /
if (!isset($SESSION['dir'])) {
$SESSION['dir'] = $homedir;
$updatetreeview = TRUE;
}
if (!empty($REQUEST['dir'])) {
$newdir = relpathtoabspath($REQUEST['dir'], $SESSION['dir']);
/ If the requested directory is a file, show the file /
if (@is_file($newdir) && @is_readable($newdir)) {
/ if (@is_writable($newdir)) {
$REQUEST['edit'] = $newdir;
} else / if (is_script($newdir)) {
$GET['showh'] = $newdir;
} else {
$GET['show'] = $newdir;
}
} elseif ($SESSION['dir'] != $newdir) {
$SESSION['dir'] = $newdir;
$updatetreeview = TRUE;
}
}
/ Show a file /
if (!empty($GET['show'])) {
$show = relpathtoabspath($GET['show'], $_SESSION['dir']);
if (!show($show)) {
$error= buildphrase('"<b>' . htmlentities($show) . '</b>"', $words['cantbeshown']);
} else {
exit;
}
}
/ Show a file syntax highlighted /
if (!empty($GET['showh'])) {
$showh = relpathtoabspath($GET['showh'], $_SESSION['dir']);
if (!show_highlight($showh)) {
$error = buildphrase('"<b>' . htmlentities($showh) . '</b>"', $words['cantbeshown']);
} else {
exit;
}
}
/ Upload file /
if (isset($FILES['upload'])) {
$file = relpathtoabspath($FILES['upload']['name'], $SESSION['dir']);
if (@is_writable($SESSION['dir']) && @move_uploaded_file($FILES['upload']['tmp_name'], $file) && (!isset($uploadedfilepermission) || chmod($file, $uploadedfilepermission))) {
$notice .= buildphrase(array('"<b>' . htmlentities(basename($file)) . '</b>"', '"<b>' . htmlentities($SESSION['dir']) . '</b>"'), $words['uploaded']);
} else {
$error = buildphrase(array('"<b>' . htmlentities(basename($file)) . '</b>"', '"<b>' . htmlentities($_SESSION['dir']) . '</b>"'), $words['notuploaded']);
}
}
/ Create directory /
if (!empty($GET['create']) && $GET['type'] == 'dir') {
$file = relpathtoabspath($GET['create'], $SESSION['dir']);
if (is_free($file) && @mkdir($file, $dirpermission)) {
$notice = buildphrase('"<b>' . htmlentities($file) . '</b>"', $words['created']);
$updatetreeview = TRUE;
if (!empty($SESSION['tree'])) {
$file = spath(dirname($file));
$SESSION['hassubdirs'][$file] = TRUE;
tree_plus($SESSION['tree'], $SESSION['hassubdirs'], $file);
}
} else {
$error = buildphrase('"<b>' . htmlentities($file) . '</b>"', $words['notcreated']);
}
}
download attachment to view php.ini (it will look garbled together if you don't download it to desktop then view it)