leatherback,
ok i tried to use what u showed me but i am really new i have read about those before but unsure as how to use them.
this is my first try at any programing at all. thanks again
here are my errors.
Array ( [file] => Array ( [name] => MVC-658F.JPG [type] => [tmp_name] => [error] => 2 [size] => 0 ) )
Warning: fopen() expects parameter 1 to be string, array given in c:\apache group\apache\htdocs\viper\scrap\sbenter.php on line 17
Warning: filesize(): Stat failed for 0 (errno=2 - No such file or directory) in c:\apache group\apache\htdocs\viper\scrap\sbenter.php on line 20
Warning: fread(): supplied argument is not a valid stream resource in c:\apache group\apache\htdocs\viper\scrap\sbenter.php on line 20
here is what i did am i useing them correctly?
<?php
include'../header.php';
if ($HTTP_GET_VARS['ulnp'] == upload) {
$file = $FILES[file];
$old_name = $FILES[file][name];
$file_name = $FILES[file][tmp_name];
$file_size = $FILES[file][size];
print_r($_FILES);
$fo = fopen($file, "rb");
echo $fo;
$data = fread($fo, filesize($file_size));
echo $data;
$text = $HTTP_POST_VARS['note'];
$date = date("m-d-Y");
$us = $_SESSION["user"];
$sbname = $HTTP_POST_VARS['sbname'];
$r2 = $con->query(" select * from sbname where sbname ='$sbname' and user = '$user'");
while ($row = $con->fetcharray($r2)) {
$type = $row['type'];
}
$result = $con->query("insert into scbook (user, type, creation_date, text, picture, file_name, file_size, file_type, sbname) values ('$us', '$type','$date', '$text', '$data', '$file_File_name', '$file_File_size', '$file_File_type', '$sbname')");
echo "<font face=verdana size=2>The file was successfully added to our database.<P>";
echo "<P><B>File Name: </B>". $file_File_name;
echo "<BR><B>File Size: </B>". $file_File_size ." bytes (approx ". ($file_File_size/1024) ." Kš";
echo "<P><B>File Type: </B>". $file_File_type;
}
?>
<table width="100%" border="0" align="center">
<tr>
<td width="100%" align="center" valign="top">
<font face=verdana size=2>
<FORM METHOD="post" ACTION="sbenter.php?ulnp=upload" ENCTYPE="multipart/form-data">
<INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="4000000000">
<INPUT TYPE="hidden" NAME="action" VALUE="upload">
<TABLE BORDER="1" cellspacing=0 cellpadding=0>
<TR>
<TD>Scrapbook info: </TD>
<TD><TEXTAREA NAME="note" ROWS="6" COLS="50" wrap="hard"></TEXTAREA></TD>
</TR>
<TR>
<TD>Picture: </TD>
<input class=\"formel_1\" type=\"hidden\" name=\"upload\" value=\"uploadabstract\">
<TD><input class=\"formel_1\" type=file name=file size=30></TD>
</TR>
<tr>
<td> Select Scrapbook to load page to:</td>
<td> <select name="sbname" id="sbname">
<?
$us = $_SESSION["user"];
$result = $con->query("SELECT id,sbname FROM sbname where user ='$us'");
while ($row = $con->fetcharray($result)){
echo '<option value="'.$row['sbname'].'">'.$row['sbname'].'</option>';
}
?>
</select> Or <a href="index.php">Create New Scrapbook</a></td>
</tr>
<TR>
<TD COLSPAN="2"><INPUT TYPE="submit" VALUE="Create Page"></TD>
</TR>
</TABLE>
</FORM>
</font>
</td>
</tr>
</table>
<?
include'../footer.php';
?>