czesc
Chcialem zrobic proste dodawanie na strone grafiki i jej miniatury znalazlem skrypcik ktory dodaje nazwe i sciezke do bazy, chcialem go powielic jednak cos czuje ze nie tedy droga mozna jakos sprawniej zrobic takie dodawanie

- drobna uwaga staram sie aby pliki ladowane w tym samym momecie uploadowaly sie do dwochy roznych miejsc
<?
if (!isset($_SESSION['db_is_logged_in']) || $_SESSION['db_is_logged_in'] !== true) { // not logged in, move to login page
header('Location: ../login_go.php'); }
?>
<form method="post" enctype="multipart/form-data">
<table width="95%" border="0">
<tr>
<td width="45%"><a href="control.php?location=listportfolio" class="link">List all entrees</a></td>
<td width="55%"> </td>
</tr>
<tr>
<td><div id="panel" align="right">image:</div></td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<input name="userfile" type="file" id="userfile" /></td>
</tr>
<tr>
<td><div id="panel" align="right">thumb image:</div></td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<input name="thumbuserfile" type="file" id="thumbuserfile" /></td>
</tr>
<tr>
<td><div id="panel" align="right">URL:</div></td>
<td><input name="port_url" type="text" value="" size="50" maxlength="50" class="box" /> </td>
</tr>
<tr>
<td valign="top" align="right"><div id="panel">short description:</div> </td>
<td><textarea name="description" cols="45" rows="12" class="box" ></textarea></td>
</tr>
<tr>
<td> </td>
<td><div id="panel"><input type="checkbox" name="tablica[0]" value="1" >
- Mark it to make this portfolio visable on website</div><br />
</td>
</tr>
<tr>
<td> </td>
<td><input name="upload" type="submit" class="box" id="upload" value=" Submit "></td>
</tr>
</table>
<table width="350" border="0" cellpadding="1" cellspacing="1" class="box">
<tr>
<td width="246">
</td>
<td width="80"></td>
</tr>
</table>
</form>
<?php
$uploadDir = 'c:/appserv/www/websign/graphic/portfolio/';
$uploadthumbsDir = 'c:/appserv/www/websign/graphic/portfolio/thumbs/';
if(isset($_POST['upload'])) {
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$thumbfileName = $_FILES['thumbuserfile']['thumb_name'];
$thumbtmpName = $_FILES['thumbuserfile']['thumb_tmp_name'];
$thumbfileSize = $_FILES['thumbuserfile']['thumb_size'];
$thumbfileType = $_FILES['thumbuserfile']['thumb_type'];
$description=$_POST['description'];
$port_url=$_POST['port_url'];
$filePath = $uploadDir . $fileName;
$thumbfilePath = $uploadthumbDir . $thumbfileName;
if (!$result ) {
echo "Error uploading file"; }
include("../config.inc.php");
{
}
$array = $_POST['tablica'];
$string = NULL;
for( $i = 0;
$i <= 0; $i++ )
{
if( ! isset ( $array[ $i ] ) ) $string .= 0;
else
$string .= $array[ $i ];
}
$query = "INSERT INTO portfolio (name, size, type, path, description, port_url, string, date, altname, thumb
_name, thumb_type, thumb_size, thumb_path )".
"VALUES ('$fileName', '$fileSize', '$fileType', '$filePath', '$description', '$port_url', '$string', '$date', 'commingsoon.gif', '$thumbfileName', '$thumbfileType','$thumbfileSize', '$thumbfilePath')";
echo "<br>File has been uploaded<br>";
}
?>
dzieki za wskazowki pozdrowka