-

 - e-mail

 

 -

   web_development

 -

 LiveInternet.ru:
: 09.03.2005
:
:
: 418

:


upload file

, 25 2005 . 18:20 +
Forky : , php ?
, , ... =(

:
PHP:

<form enctype="multipart/form-data" action="upload.php" method="POST">
<
input type="hidden" value="1999999" />
<
input type="file" />
<
input type="submit" value="" />
</
form>
font>


print_r($_FILES), Array().
: move_uploaded_file($_FILES['forpost']['tmpname'], "images/somename") . ? , .. , $_FILES.
copy($_POST[forpost], 'destination'), , . " " fopen($_POST[forpost], 'rb').

, , . Ftp - ( php ).

: [1] []
Forky   Re: upload file , 25 2005 . 18:23 ()
... - , . MAX_FILE_SIZE . , =)
input type=file name=forpost
,

LI 3.9.25
   
QaSt   , 25 2005 . 18:25 ()
, :)
PHP:

case addhouse:
    
$submit=$_POST['submit'];
    if(!
$submit)
    {
    echo 
"&#194;&#226;&#229;&#228;&#232;&#242;&#229; &#232;&#237;&#244;&#238;&#240;&#236;&#224;&#246;&#232;&#254; &#238; &#237;&#229;&#228;&#226;&#232;&#230;&#232;&#236;&#238;&#241;&#242;&#232;
    <form action='"
?module=base&page=admin&sub=addhouse"' method='"post"' enctype='"multipart/form-data"'>
    <table class="
nd1">
    <tr><td class="
nd2">&#236;&#229;&#241;&#242;&#238;&#237;&#224;&#245;&#238;&#230;&#228;&#229;&#237;&#232;&#229;</td><td>
    <select size="
1">";
    
$where_query=mysql_query("SELECT * FROM `".dbprefix."ubn_where` WHERE `sub`='0';");
    while(
$where=mysql_fetch_array($where_query))
    {
     echo 
"<optgroup label='"".$where[name].""'>";
     
$street_query=mysql_query("SELECT * FROM `".dbprefix."ubn_where` WHERE `sub`='".$where[id]."';");
     while(
$street=mysql_fetch_array($street_query))
     {
      echo 
"<option value='"".$street[id].""'>".$street[name]."</option>";
     }
     echo 
"</optgroup>";
    }
    echo 
"</select></td></tr>
    <tr><td class="
nd2">&#234;&#238;&#235;-&#226;&#238; &#234;&#238;&#236;&#237;&#224;&#242;</td><td><input type="text" /></td></tr>
    <tr><td class="
nd2">&#242;&#232;&#239; &#239;&#240;&#238;&#229;&#234;&#242;&#224;</td><td>";
    echo 
"<select size="1">";
    
list_type_project();
    echo 
"</select>";
    echo 
"</td></tr>
    <tr><td class="
nd2">&#253;&#242;&#224;&#230;&#226;&#241;&#229;&#227;&#238; &#253;&#242;&#224;&#230;&#229;&#233;</td><td><input type="text" size='"3"' /><input type="text" size='"3"' /></td></tr>
    <tr><td class="
nd2">&#236;&#224;&#242;&#229;&#240;&#232;&#224;&#235; &#228;&#238;&#236;&#224;</td><td>";
    echo 
"<select size="1">";
    
list_type_material();
    echo 
"</select>";
    echo 
"</td></tr>
    <tr><td class="
nd2">&#239;&#235;&#238;&#249;&#224;&#228;&#252;(&#238;&#225;&#249;.,&#230;&#232;&#235;.,&#234;&#243;&#245;.)</td><td><font size="2">&#226;&#226;&#238;&#228;&#232;&#242;&#252; &#226; &#226;&#232;&#228;&#229; X/X/X(&#237;&#224;&#239;&#240;&#232;&#236;&#229;&#240; 1/2/3)</font><input type="text" /></td></tr>
    <tr><td class="
nd2">&#225;&#224;&#235;&#234;&#238;&#237;</td><td>";
    echo 
"<select size="1">";
    
list_type_balkon();
    echo 
"</select>";
    echo 
"</td></tr>
    <tr><td class="
nd2">&#241;&#224;&#237;&#243;&#231;&#229;&#235;</td><td>";
    echo 
"<select size="1">";
    
list_type_san();
    echo 
"</select>";
    echo 
"</td></tr>
    <tr><td class="
nd2">&#231;&#224;&#227;&#240;&#243;&#231;&#232;&#242;&#252; &#244;&#238;&#242;&#238;</td><td><input type='"file"' size="30" /></td></tr>
    <tr><td class="
nd2">&#246;&#229;&#237;&#224; USD</td><td><input type="text" /></td></tr>
    <tr><td class="
nd2">&#202;&#238;&#236;&#236;&#229;&#237;&#242;&#224;&#240;&#232;&#233;:</td><td><textarea rows="20" cols="30"></textarea></td></tr>
    </table>
    <input type='"
submit"' value='"&#228;&#238;&#225;&#224;&#226;&#232;&#242;&#252;"' class='"inputButton"' /></form>";
    
}
    if(
$submit)
    {
     
$where=$_POST['where'];
     
//echo "<font color="red">".$where."</font>";
     
$kom=$_POST['kom'];
     
$proekt=$_POST['proekt'];
     
$etaj=$_POST['etaj'];
     
$etajmax=$_POST['etajmax'];
     
$material=$_POST['material'];
     
$s=$_POST['s'];
     
$bal=$_POST['bal'];
     
$san=$_POST['san'];
     
//$filename=$_POST['filename'];
     
$cost=$_POST['cost'];
     
$comment=$_POST['comment'];
     if (
$filename != "")
     {
      
move_uploaded_file($filename"./img/upl/".basename($filename_name));
      print 
"&#212;&#224;&#233;&#235; &#231;&#224;&#234;&#224;&#247;&#224;&#237;:";
      
$img="./img/upl/".basename($filename_name);
      echo 
"".basename($filename_name);
      echo 
"".$img."<img src='"".$img.""' />";
     }
     else 
$img="0";
     
$time=time();
     echo 
$where;
     
$sid=mysql_result(mysql_query("SELECT MAX(id) FROM `".dbprefix."ubn_house`;"),"0") +1;
     
mysql_query("INSERT INTO `".dbprefix."ubn_house` VALUES ('".$sid."', '".$where."', '".$time."', '".$kom."', '".$proekt."', '".$etaj."', '".$etajmax."', '".$material."', '".$s."', '".$bal."', '".$san."', '".$img."', '".$cost."', '".$comment."');") or die("<font color="red">&#237;&#229;&#226;&#238;&#231;&#236;&#238;&#230;&#237;&#238; &#228;&#238;&#225;&#224;&#226;&#232;&#242;&#252;!'".$sid."', '".$where."', '".$time."', '".$kom."', '".$proekt."', '".$etaj."', '".$etajmax."', '".$material."', '".$s."', '".$bal."', '".$san."', '".$img."', '".$cost."', '".$comment."'</font>");
     echo 
"&#206;&#225;&#250;&#229;&#234;&#242; &#228;&#238;&#225;&#224;&#226;&#235;&#229;&#237; &#226; &#225;&#224;&#231;&#243; &#228;&#224;&#237;&#237;&#251;&#245;.<a href='"?module=base"'>&#237;&#224;&#231;&#224;&#228;</a>";
    }
    break;
font>

   
QaSt   , 25 2005 . 18:27 ()
, %)
   
VictorT   , 25 2005 . 18:29 ()
input type="file" name ...
   
Forky   Re: web_development; upload file , 25 2005 . 18:35 ()
VictorT: input type="file" name ...

name. , [ p h p ] , - , =(

, , =) , ...

LI 3.9.25
   
shakirov   , 25 2005 . 18:51 ()
? .
   
Forky   Re: web_development; upload file , 25 2005 . 19:01 ()
...
!
: move_uploaded_file($_FILES['somename']['tmp_name'], "images/i.txt")
, . . , $_FILES . $HTTP_POST_FILES .

LI 3.9.25
   
Forky   Re: web_development; upload file , 25 2005 . 19:14 ()
:
:

if ($_FILES['somename']['tmp_name']!=false)
copy($_FILES['somename']['tmp_name'], "images/i.jpg");
else
echo "FUCK!!!";

FUCK!!!

LI 3.9.25
   
Forky   Re: web_development; upload file , 25 2005 . 19:19 ()
, , - !
: (upload.html), (upload.php). , =)
.
. Forky.

LI 3.9.25
   
Forky   Re: web_development; upload file , 25 2005 . 19:29 ()
:
<html><head><title></title></head><body>
<form enctype="multipart/form-data" action='//www.liveinternet.ru/journal_proc.php?action=redirect&url=up.php' method='POST'>
<input type="hidden" name="MAX_FILE_SIZE" value="1999999">
<input type='file' name='somename'>
<input type=submit value=>
</form>
<?php
if ($_FILES['somename']['tmp_name']!=false) {
copy($_FILES['somename']['tmp_name'], "images/i.txt");
echo "!!!!";}
else
echo "Fuck";
?>
</body></html>

.

LI 3.9.25
   
: [1] []
 

:
: 

: ( )

:

  URL