/    Sign up×
Community /Pin to ProfileBookmark

Multiple uploads at the same time.

Hi and thank you for stop here.

I made this script that upload 1 file and create a folder for this using as name a column from MYSQL. My problem is I have a very small knowledge of PHP and I will love to upload more pictures at the same time. I’m sure this is very easy if you know how to use variables.

Any help will very appreciate.

Here is the page where I browse the files:
[COLOR=Red]Index.php[/COLOR]

[B]At the moment I can upload the picture only with button:<input name=”archivo” type=”file” id=”archivos” />[/B]

[code=php] <td>Pictures 6 </td>
<td>
<input name=”MAX_FILE_SIZE” type=”hidden” value=”100000″>
<input name=”Pictures6″ type=”file” id=”Pictures6″ /> </td>
</tr>
<tr>
<td>Pictures 7 </td>
<td>
<input name=”MAX_FILE_SIZE” type=”hidden” value=”100000″>
<input name=”archivo” type=”file” id=”archivos” />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type=”submit” name=”Submit” value=”Submit” /></td>
</tr>
<tr><td>
</form>

</td></tr>
</table>

</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
[/code]

Here is the uploading process + the creation of the folder
[COLOR=Red]insert_procesador.php[/COLOR]

[code=php]<?php require_once(‘../../Connections/conn_newland.php’); ?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<META HTTP-EQUIV=”Pragma” CONTENT=”no-cache”>
<META HTTP-EQUIV=”Expires” CONTENT=”-1″>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<style type=”text/css”>
<!–
.style3 {font-size: 14px; font-family: Verdana, Arial, Helvetica, sans-serif;}
–>
</style>
</head>

<body>
<span class=”style3″>
<li>
<?php
//
//Conecion a la DB
//
mysql_select_db($database_conn_newland, $conn_newland);
$query_Llamar_ID = “SELECT ID FROM tbl_news ORDER BY ID DESC”;
$Llamar_ID = mysql_query($query_Llamar_ID, $conn_newland) or die(mysql_error());
$row_Llamar_ID = mysql_fetch_assoc($Llamar_ID);
$totalRows_Llamar_ID = mysql_num_rows($Llamar_ID);

//
//Crea el folder
//
$addition = $row_Llamar_ID[‘ID’] + 1;
$itemCount = $addition ;
// “./” agrega ./ a la ruta del archivo JPEG
//$newDir = “./” . $itemCount;
$newDir = $itemCount;
mkdir($newDir);

$Pictures6 = archivo
//
//Hace el upload
//
$extension = explode(“.”,$_FILES[‘archivo’][‘tmp_name’]);

echo $extension;
$num = count($extension)-1;

if(($_FILES[‘archivo’][‘type’] == “image/pjpeg”) or ($_FILES[‘archivo’][‘type’]== “image/gif”)) {
/*
“$newDir/” Manda la foto a el nuevo folder creado.
“files/” Manda la foto a un folder llamado files.
*/
if(!move_uploaded_file($_FILES[‘archivo’][‘tmp_name’], “$newDir/”.$_FILES[‘archivo’][‘name’])) {
//if(!move_uploaded_file($_FILES[‘archivo’][‘tmp_name’], “files/”.$_FILES[‘archivo’][‘name’])) {
echo “error al copiar el archivo”;
}
else {
echo ” El archivo: “. $_FILES[‘archivo’][‘name’] .” se ha subido con exito”;
}
}
else {
echo “el formato de archivo no es valido, solo se admiten imagenes gif o jpg”;
}
?>

<br><br>
<li>
<?php
//echo “Este es el folder de destino para la imagen: ” .”$newDir/”.”$archivo”. $_FILES[‘archivo’][‘name’];
echo “Este es el folder de destino para la imagen: ” .”$newDir/”.$_FILES[‘archivo’][‘name’];
$resultado = “$newDir/”.$_FILES[‘archivo’][‘name’];

?>

<br>
<br>

<?php
$host = “localhost”;
$user = “root”;
$pwd = “root”;

$dbConn = mysql_connect($host,$user,$pwd);
$database = “newland_tours”;
mysql_select_db($database, $dbConn);

$query_rs_insert_news = “INSERT INTO tbl_news (Title, Country, City, Date,
1d, 2e, 3es, 4f, 5i, 6p, 7o, deutch, english, espanol, francaise, italiano,
portugues, otro, Picture1, Picture2, Picture3, Picture4, Picture5, Picture6,
Picture7) VALUES (‘”.$_POST[‘Title’].”‘, ‘”.$_POST[‘Country’].”‘,
‘”.$_POST[‘City’].”‘, ‘”.$_POST[‘Date’].”‘, ‘”.$_POST[‘1d’].”‘,
‘”.$_POST[‘2e’].”‘, ‘”.$_POST[‘3es’].”‘, ‘”.$_POST[‘4f’].”‘, ‘”.$_POST[‘5i’].”‘,
‘”.$_POST[‘6p’].”‘, ‘”.$_POST[‘7o’].”‘, ‘”.$_POST[‘1deutsch’].”‘,
‘”.$_POST[‘2english’].”‘, ‘”.$_POST[‘3espanol’].”‘,
‘”.$_POST[‘4francaise’].”‘, ‘”.$_POST[‘5italiano’].”‘,
‘”.$_POST[‘6portugues’].”‘, ‘”.$_POST[‘7otro’].”‘,
‘”.$_POST[‘Pictures1’].”‘, ‘”.$_POST[‘Pictures2’].”‘,
‘”.$_POST[‘Pictures3’].”‘, ‘”.$_POST[‘Pictures4’].”‘,
‘”.$_POST[‘Pictures5’].”‘, ‘”.$_POST[‘Pictures6’].”‘,
‘”.$resultado.”‘)”;
$rs_insert_news = @mysql_query($query_rs_insert_news);
if($rs_insert_news){
echo “hola”.$_FILES[‘uno’][‘name’];
}else{
echo mysql_error();
};

mysql_free_result($Llamar_ID);
?>
</span>
</body>
</html> [/code]

[COLOR=Red][SIZE=5]all the files here[/SIZE][/COLOR]

[upl-file uuid=46fddc20-8bd8-4f14-bb8f-725e08d88742 size=3kB]files.zip[/upl-file]

to post a comment
PHP

13 Comments(s)

Copy linkTweet thisAlerts:
@bokehMay 31.2005 — Hi! I have not bothered looking into your code in depth but since no one else has replied I will try to point you in the right direction. First I have made a simple form that uses a repetative <input> tag. The form puts all the uploaded file details an array called '$_FILES['archivos']'. My script just prints all the details from that array using a 'while' loop but you can do whatever you want with them (save file, etc.). As this is the bit you are having trouble with I hope my script will help you. Salud y Republica![code=php]<?php

//Find url: self
$self = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];

// Make form
echo <<<END
<form action="$self" enctype="multipart/form-data" method="post">
<input name="archivos[]" type="file" id="archivos[]"><br>
<input name="archivos[]" type="file" id="archivos[]"><br>
<input name="archivos[]" type="file" id="archivos[]"><br>
<input type="submit" name="Submit" value="Submit"><br><br><br>
END;


// Print details for each file
$i = 0;
while(isset($_FILES['archivos']['name'][$i])){
if(!empty($_FILES['archivos']['name'][$i])){
print("<pre>
File number in array: $i
Filename: {$_FILES['archivos']['name'][$i]}
File temp name: {$_FILES['archivos']['tmp_name'][$i]}
File type: {$_FILES['archivos']['type'][$i]}
File size: {$_FILES['archivos']['size'][$i]}

</pre>");
}
$i++;
}
?>[/code]
Copy linkTweet thisAlerts:
@VernonKMay 31.2005 — The best way to do this IMHO is to generate a small form that has a drop-down of how many uploads you would like to do. I don't recommend more than 5-6 at a time because they can get broken due to browser timeouts.

$_POST that value (the number you would like to upload) and then use a for() loop to generate the requested number of upload fields.

Either store the number of fields in a hidden input field or in a $_SESSION variable.

When you submit then run another for() loop that will run for the number of uploads. Each time uploading the next file.
Copy linkTweet thisAlerts:
@Stephen_PhilbinMay 31.2005 — I'm about to hit the hay for the night so I don't really have time to go making any custom solutions for you, but I can try to point you in the right direction. If you're going to try and make file upload scripts you really need to read about and learn about arrays in PHP. Arrays aren't complicated, in fact they're rather simple, but they are pretty central to handling file uploads from forms. If you're trying to handle uploads of multiple files from a single for then getting familiar with the idea of multi-dimensional arrays would be an extremely good idea. Arrays are also quite central to many other aspects of scripting with PHP. So once you've got the swing of variables and operators, get right on to arrays. ?

http://www.zend.com/manual/ <---- Essential reading.
Copy linkTweet thisAlerts:
@bokehJun 01.2005 — I posted my original script to try to get you thinking about how the array works but if you need a spoon fed answer here it is. Just take out the bits you don't need. You also need to read this: [URL=http://es2.php.net/manual/en/features.file-upload.errors.php]$_FILES['archivos']['error'][/URL]. Salud y republica![code=php]<?php

//Find url: self
$self = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];

// Make form
echo <<<END
<form action="$self" enctype="multipart/form-data" method="post">
<input name="archivos[]" type="file" id="archivos[]"><br>
<input name="archivos[]" type="file" id="archivos[]"><br>
<input name="archivos[]" type="file" id="archivos[]"><br>
<input type="submit" name="Submit" value="Submit"></form><br>
END;


//Save uploaded files
$uploads_directory = $_SERVER['DOCUMENT_ROOT'] . '/'; // Fill this in. Must end with a slash (/)
$i = 0;
while(isset($_FILES['archivos']['name'][$i])){
if(!empty($_FILES['archivos']['name'][$i])){
if($_FILES['archivos']['error'][$i]==0){
if(!file_exists($uploads_directory . $_FILES['archivos']['name'][$i])){
if(is_uploaded_file($_FILES['archivos']['tmp_name'][$i])){
if (move_uploaded_file($_FILES['archivos']['tmp_name'][$i], $uploads_directory . $_FILES['archivos']['name'][$i])) {
print("Success saving the file '{$_FILES['archivos']['name'][$i]}' (file
number '$i' in the array) in the directory '$uploads_directory' <br>");
}else{
print("Failure saving the file '{$_FILES['archivos']['name'][$i]}' (file
number '$i' in the array) in the directory '$uploads_directory' <br>");
}
}
}else{
print("A file named '{$_FILES['archivos']['name'][$i]}' (file number '$i' in
the array) already exists in the directory '$uploads_directory'. Please rename
your file and try again <br>");
}
}
}
$i++;
}
?>[/code]
Copy linkTweet thisAlerts:
@_LOBO_authorJun 01.2005 — first of all thank you guys for stop here I was loosing my hope ?.

bokeh: I was trying to anylise your code and if Im right It will remplace my original form right?. but on the original form I create y folder using a name form my DB + it work I need just to be able to upload more than one file at the same time. What I do now is create my form:
[code=php] <input name="MAX_FILE_SIZE" type="hidden" value="100000">
<form name="form1" id="form1" action="insert_procesador.php" enctype="multipart/form-data" method="post" >[/code]


with three buttons:
[code=php]
<td><input name="archivo3" type="file" /></td>
</tr>
<tr>
<td>Pictures 6 </td>
<td><input name="archivo2" type="file" /></td>
</tr>
<tr>
<td>Pictures 7 </td>
<td>

<input name="archivo" type="file" />
[/code]


<input name="archivo" type="file" /> work just fine but I need to "grab" archivo2 / archivo3 etc...

with help of a friend (jorge) I put this on my form (index.php)
[code=php] <?php $cantidad = $_POST['total']; //campo hidden del for
for($i=1; $i<=$cantidad; $i++){
$tmp_name = $_FILES['archivo'.$i]['tmp_name']; //campos archivo1,
//archivo2, archivo3, etc
$name = $_FILES['archivo'.$i]['name'];
$type = $_FILES['archivo'.$i]['type'];

//Todo el resto, pero usando ahora estas variables
$_FILES['archivo3'][tmp_name];
} ?> [/code]


with this three buttons

[code=php]
<td><input name="archivo3" type="file" /></td>
</tr>
<tr>
<td>Pictures 6 </td>
<td><input name="archivo2" type="file" /></td>
</tr>
<tr>
<td>Pictures 7 </td>
<td>
<input name="archivo" type="file" /> </td>
[/code]


I select a picture (is the same picture with diferent name) for each button but only [B]<input name="archivo" type="file" />[/B](this is the original button that if work from the begining) made the upload.

thank you again for your help ?
Copy linkTweet thisAlerts:
@bokehJun 01.2005 — Ok! First of all you are making it very complicated by using your style of <input> tag. I used

<input name="archivos[]" type="file">

but for some reason you want to number the inputs like this

<input name="archivos[]" type="file">!

Anyway if that's the way you want to do it let's try it that way.

Name the inputs like this:

archivos1

archivos2

archivos3

not like this:

archivos

archivos2

archivos3

Now have a look at this:[code=php]if(!empty($_FILES)){ // Check for uploaded files

$uploads_directory = $_SERVER['DOCUMENT_ROOT'] . '/'; // Fill this in. Must end with a slash '/'

$cantidad = count($_FILES); // Count number of keys in the $_FILES array

for($i=1; $i<=$cantidad; $i++){ // Start 'for' loop
if($_FILES['archivo'.$i]['error']==0){ // Check for '0' upload error (file uploaded ok)

$tmp_name = $_FILES['archivo'.$i]['tmp_name']; // This is your code
$name = $_FILES['archivo'.$i]['name']; // This is your code
$type = $_FILES['archivo'.$i]['type']; // This is your code

// Now you have this data, do something with it like
// save it or put the files or write to the database.

// The following saves a file each time the loop is iniciated
move_uploaded_file($tmp_name, $uploads_directory . $name);

//Or we could print the file details
print("<pre>
tmp_name: $tmp_name
name: $name
type: $type
</pre>");

//Or write some details in the database, etc.

} //End: if($_FILES['archivo'.$i]['error']==0){

} // End: for($i=1; $i<=$cantidad; $i++){

} // End: if(!empty($_FILES)){[/code]
It is to replaces this:[code=php]$cantidad = $_POST['total']; //campo hidden del for
for($i=1; $i<=$cantidad; $i++){
$tmp_name = $_FILES['archivo'.$i]['tmp_name']; //campos archivo1,
//archivo2, archivo3, etc
$name = $_FILES['archivo'.$i]['name'];
$type = $_FILES['archivo'.$i]['type'];

//Todo el resto, pero usando ahora estas variables
$_FILES['archivo3'][tmp_name];
}[/code]
Now if you join that together with what I posted earlier in my two fully functional scripts above you will get this, which is also fully functional:[code=php]<?php

//Find url: self
$self = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];

// Make form
echo <<<END
<form action="$self" enctype="multipart/form-data" method="post">
<input name="archivo1" type="file"> <br>
<input name="archivo2" type="file"> <br>
<input name="archivo3" type="file"> <br>
<input type="submit" name="Submit" value="Submit"></form><br>
END;


if(!empty($_FILES)){ // Check for uploaded files

$uploads_directory = $_SERVER['DOCUMENT_ROOT'] . '/'; // Fill this in. Must end with a slash '/'

$cantidad = count($_FILES); // Count number of keys in the $_FILES array

for($i=1; $i<=$cantidad; $i++){ // Start 'for' loop
if($_FILES['archivo'.$i]['error']==0){ // Check for '0' upload error (file uploaded ok)

$tmp_name = $_FILES['archivo'.$i]['tmp_name']; // This is your code
$name = $_FILES['archivo'.$i]['name']; // This is your code
$type = $_FILES['archivo'.$i]['type']; // This is your code

// Now you have this data, do something with it like
// save it or put the files or write to the database.

// The following saves a file each time the loop is iniciated
move_uploaded_file($tmp_name, $uploads_directory . $name);

//Or we could print the file details
print("<pre>
tmp_name: $tmp_name
name: $name
type: $type
</pre>");

//Or write some details in the database, etc.

} //End: if($_FILES['archivo'.$i]['error']==0){

} // End: for($i=1; $i<=$cantidad; $i++){

} // End: if(!empty($_FILES)){


?>[/code]
Copy linkTweet thisAlerts:
@_LOBO_authorJun 01.2005 — I have an error on the line 112 [B]echo <<<END [/B]

[code=php]<?php require_once('../../Connections/conn_newland.php'); ?>
<?php
mysql_select_db($database_conn_newland, $conn_newland);
$query_Recordset1 = "SELECT ID FROM tbl_news ORDER BY ID DESC";
$Recordset1 = mysql_query($query_Recordset1, $conn_newland) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

// Set up connection to MySQL
$host = "localhost";
$user = "root";
$pwd = "root";
$dbConn = mysql_connect($host,$user,$pwd);
// Connect to newland_tours database
$database = "newland_tours";
mysql_select_db($database);
$query_rs_news = "SELECT * FROM tbl_news ORDER BY Date";
$rs_news = mysql_query($query_rs_news);
$row_rs_news = mysql_fetch_assoc($rs_news);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>

<body>

<table width="485" border="0" cellspacing="0" cellpadding="5">
<input name="MAX_FILE_SIZE" type="hidden" value="100000">
<input name="total" type="hidden" value="10">
<form name="form1" id="form1" action="insert_procesador.php" enctype="multipart/form-data" method="post" >
<tr>
<td width="156">Title:</td>
<td width="309"><input name="Title" type="text" id="Title" /></td>
</tr>
<tr>
<td>Country:</td>
<td><input name="Country" type="text" id="Country" /></td>
</tr>
<tr>
<td>City:</td>
<td><input name="City" type="text" id="City" /></td>
</tr>
<tr>
<td>Date YYYY-MM-DD:</td>
<td><input name="Date" type="text" id="Date" /></td>
</tr>
<tr>
<td>Language:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>1 deutsch :

<input name="1d" type="checkbox" id="1d" value="checkbox" /></td>
<td><textarea name="1deutsch" cols="50" rows="10" id="1deutsch"></textarea></td>
</tr>
<tr>
<td>2 english :
<input name="2e" type="checkbox" id="2e" value="checkbox" /></td>
<td><textarea name="2english" cols="50" rows="10" id="2english"></textarea></td>
</tr>
<tr>
<td>3 espa&ntilde;ol :
<input name="3es" type="checkbox" id="3es" value="checkbox" /></td>
<td><textarea name="3espanol" cols="50" rows="10" id="3espanol"></textarea></td>
</tr>
<tr>
<td>4 fran&ccedil;aise :
<input name="4f" type="checkbox" id="4f" value="checkbox" /></td>
<td><textarea name="4francaise" cols="50" rows="10" id="4francaise"></textarea></td>
</tr>
<tr>
<td>5 italiano:
<input name="5i" type="checkbox" id="5i" value="checkbox" /></td>
<td><textarea name="5italiano" cols="50" rows="10" id="5italiano"></textarea></td>
</tr>
<tr>
<td>6 portugu&ecirc;s :
<input name="6p" type="checkbox" id="6p" value="checkbox" /></td>
<td><textarea name="6portugues" cols="50" rows="10" id="6portugues"></textarea></td>
</tr>
<tr>
<td>7 other :
<input name="7o" type="checkbox" id="7o" value="checkbox" /></td>
<td><textarea name="7other" cols="50" rows="10" id="7other"></textarea></td>
</tr>
<tr>
<td><span class="style1">ID/Picture Folder </span></td>
<td><span class="style1">
<?php $addition = $row_Recordset1['ID'] + 1;
echo "Nombre del folder para las fotos = " . $addition . "<br />"; ?>
</span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td> <?php

//Find url: self
$self = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];

// Make form
echo <<<END
<form action="$self" enctype="multipart/form-data" method="post">
<input name="archivo1" type="file"> <br>
<input name="archivo2" type="file"> <br>
<input name="archivo3" type="file"> <br>
<input type="submit" name="Submit" value="Submit"></form><br>
END;

if(!empty($_FILES)){ // Check for uploaded files

$uploads_directory = $_SERVER['DOCUMENT_ROOT'] . '/'; // Fill this in. Must end with a slash '/'

$cantidad = count($_FILES); // Count number of keys in the $_FILES array

for($i=1; $i<=$cantidad; $i++){ // Start 'for' loop
if($_FILES['archivo'.$i]['error']==0){ // Check for '0' upload error (file uploaded ok)

$tmp_name = $_FILES['archivo'.$i]['tmp_name']; // This is your code
$name = $_FILES['archivo'.$i]['name']; // This is your code
$type = $_FILES['archivo'.$i]['type']; // This is your code

// Now you have this data, do something with it like
// save it or put the files or write to the database.

// The following saves a file each time the loop is iniciated
move_uploaded_file($tmp_name, $uploads_directory . $name);

//Or we could print the file details
print("<pre>
tmp_name: $tmp_name
name: $name
type: $type
</pre>");

//Or write some details in the database, etc.

} //End: if($_FILES['archivo'.$i]['error']==0){

} // End: for($i=1; $i<=$cantidad; $i++){

} // End: if(!empty($_FILES)){


?></td>
</tr>
<tr>
<td>Pictures 1 </td>
<td><input name="Pictures1" type="text" id="Pictures 1" /></td>
</tr>
<tr>
<td>Pictures 2 </td>
<td><input name="Pictures2" type="text" id="Pictures2" /></td>
</tr>
<tr>
<td>Pictures 3 </td>
<td><input name="Pictures3" type="text" id="Pictures3" /></td>
</tr>
<tr>
<td>Pictures 4 </td>
<td><input name="Pictures4" type="text" id="Pictures4" /></td>
</tr>
<tr>
<td>Pictures 5 </td>
<td><input name="archivos2" type="file" id="archivos2" /></td>
</tr>
<tr>
<td>Pictures 6 </td>
<td><input name="archivos1" type="file" id="archivos1" /></td>
</tr>
<tr>
<td>Pictures 7 </td>
<td>
<input name="archivo" type="file" /> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" name="Submit" value="Submit" /></td>
</tr>
<tr><td>
</form>


</td></tr>
</table>

</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
[/code]
Copy linkTweet thisAlerts:
@bokehmanJun 01.2005 — I have an error on the line 112 [B]echo <<<END [/B][/QUOTE]

<<<END

Must not have any white space following it. Put the cursor immediately next to the 'D' and press enter so you can be certain there is nothing after the 'D'. If there is any empty space after the 'D' on the same line you will get an error.

By the way have you run my scripts or just looked at them? Also if you want to know what the $_FILES array looks like when it is loaded with data here is an example:

[code=html]$_FILES
Array (
[archivos1] =>
Array (
[name] => release.html
[type] => text/html
[tmp_name] => c:/wamp/tmpphp13A.tmp
[error] => 0
[size] => 2827
)
[archivos2] =>
Array (
[name] => release.html
[type] => text/html
[tmp_name] => c:/wamp/tmpphp13B.tmp
[error] => 0
[size] => 2827
)
[archivos3] =>
Array (
[name] => release.html
[type] => text/html
[tmp_name] => c:/wamp/tmpphp13C.tmp
[error] => 0
[size] => 2827
)
)
[/code]
Copy linkTweet thisAlerts:
@_LOBO_authorJun 01.2005 —  <<<END

Must not have any white space following it. Put the cursor immediately next to the 'D' and press enter so you can be certain there is nothing after the 'D'. If there is any empty space after the 'D' on the same line you will get an error.
[/QUOTE]

Ok the problem was that echo <<<END and the same thing with END;


By the way have you run my scripts or just looked at them? [/QUOTE]


? heheh running offcourse. Ok It works now the problem was the wite spaces that I din't know will afect the code (Im totaly new with PHP).

Now The problem that I see is that the idea of my form (I posted on my firts post ? ) is create the folder for the pictures using a number on my data base this number will change with auto_incremet. If is not to much ask can you dwonload all my code and take a look please becouse I can upload one picture at the time and it work, I will love just to add the opther inputs and adapt the old code to upload more pictures.

I really apretiate your help
Copy linkTweet thisAlerts:
@_LOBO_authorJun 01.2005 — UC your script working:http://img243.echo.cx/my.php?image=untitled17fm.jpg

what I need to make work:[URL=http://img243.echo.cx/my.php?image=need0yx.gif][IMG]http://img243.echo.cx/img243/2139/need0yx.th.gif[/IMG][/URL]

all the source code.

http://s4.yousendit.com/d.aspx?id=1Z4TH0BDVFPJA04FCLVYUSEYW2
Copy linkTweet thisAlerts:
@bokehmanJun 01.2005 — The truth is I have only been playing with PHP for a few short months and only for fun. I have never needed to use a database for any of my applications so I have never learned how MySql works. Sorry but you will have to get someone elses help on that.
Copy linkTweet thisAlerts:
@_LOBO_authorJun 01.2005 — but all the stuff that work with the DB is done and it work, The script read the DB and Send the path from the picture to MYSQL also create the folder fro the pictures using MYSQL the only thing is that I need to use variables to send more then one picture ?

download my code http://s4.yousendit.com/d.aspx?id=1Z4TH0BDVFPJA04FCLVYUSEYW2

And thank you fro your help
Copy linkTweet thisAlerts:
@bokehmanJun 01.2005 — Just add the details to the database about each indiviual from the loop at the same time as you work on the file. That way $cantidad will already have the correct value. Where my script printed the details from each iteration of the loop yours needs to add that info to the database. Just replace my print statements with your database entry statements.
×

Success!

Help @_LOBO_ spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...