drisate
Members-
Posts
805 -
Joined
-
Last visited
Everything posted by drisate
-
OMG ! thx rarebit i added ie to your string and it worked thank you so much bro!
-
Well i just tryed this $content = preg_replace('/\[CAL(=([0-9]+)\/([0-9]))?\]/ie', "getJobs($2, 'CAL')", $content); And it's not working either ... [CAL=2008/10] stays unreplaced The reason why i tryed it in the same () is because 2008/10 should be 1 value But i am not an expert on the question so i might be wrung ...
-
hehe this is what i was planning to do if (!function_exists('getJobs')) { function getJobs($limit=NULL, $type) { if ($type=="JOB"){$table="jos_jl_jobposting"; $col="title";} if ($type=="SHOP"){$table="jos_marketplace_ads"; $col="ad_headline";} if ($type=="CAL"){$table="jos_extcal_events"; $col="title"; $limit="10";} $query = "SELECT * FROM $table"; if ($limit != null) { $query .= " LIMIT $limit"; } $res = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_assoc($res)) { $jobs[] = $row[$col]; } return implode('<br />', $jobs); } } $content = preg_replace('/\[JOB(=([0-9]+))?\]/ie', "getJobs($2, 'JOB')", $content); $content = preg_replace('/\[sHOP(=([0-9]+))?\]/ie', "getJobs($2, 'SHOP')", $content); $content = preg_replace('/\[CAL(=([0-9]+\/[0-9]))?\]/ie', "getJobs($2, 'CAL')", $content); The first 2 works great but [CAL=2008/10] is not recognized. the reason i added $limit="10"; to the CAL if type is because i did not create the SQL string to retrieve the data by date. Anyway, looks like $content = preg_replace('/\[CAL(=([0-9]+\/[0-9]))?\]/ie', "getJobs($2, 'CAL')", $content); is not recognizing [CAL=2008/10].
-
Hey guys i have a tag that looks like this [CAL=02/2008] i tried using $content = preg_replace('/\[CAL(=([0-9]+/[0-9]))?\]/ie', "getJobs($2, 'CAL')", $content); but it gives me this error Warning: preg_replace() [function.preg-replace]: Unknown modifier '[' in /home/direct/public_html/administrator/components/com_acajoom/classes/class.jmail.php on line 160
-
1) It's impossible that it worked for you because you specified a 1 as the second parameter of array_rand, which tells it how many items to get random keys for, and when you put 1 (default anyway), it returns the key by itself and not an array. 2) Use <br /> and not <br>. Cmon bro, did you try it? http://www.phpecono.com/array.php Works like a charm. This is an exemple suggested by PHP.net
-
the code i gave you worked for me <?php $input = array("first","second","third","fourth","fifth"); $rand_keys = array_rand($input, 5); echo $input[$rand_keys[0]]."<br>"; echo $input[$rand_keys[1]]."<br>"; echo $input[$rand_keys[2]]."<br>"; echo $input[$rand_keys[3]]."<br>"; echo $input[$rand_keys[4]]."<br>"; ?> You just had to change the vars do do what you wanted to do bro
-
omg thx guys. Everything is crystal clear now :-)
-
<?php $input = array("first","second","third","fourth","fifth"); $rand_keys = array_rand($input, 1); echo $input[$rand_keys[0]]; ?>
-
By the way, use the numbers it returns in your var like this to get the value echo $array[$num];
-
If you can, i would recommend using this select * from yourtable order by rand() limit 0,1; A lot faster
-
use this http://ca3.php.net/array_rand
-
Hey guys. I have a client that would like me to create a code that would replace a tag by a module in his emails Ex: [JOB=10] Would output the last 10 posted jobs. If the tag was a simple [JOB] I would just search it and replace it ... but the problem is not only i have to find it, but I have to extract the unknown value, use it to create a replace output, then replace the unknown string by the replace output ... Help! Lol
-
Hi guys. I am trying to build a script that updates the users account balance after a paiement is made but for some reason it's not working well. Current user balance: -53.88 ($amt) Paiement is 53.88 ($alertpay_data[16]) The balance should be 0 ... ($amts) -53.88+53.88=0 But for some reason is says the new balance is 53.88 with out any - in front so i asum it became a positive value ... Weird. I don't get it. $UPDATE = mysql_query("UPDATE atransaction SET end_date='$end_date', amt_paid='$alertpay_data[16]', end_stamp='$end_stamp', status='2', alertpay='$alertpay' where id_membre = '$transaction_data[1]' and id='$transaction_data[$theloop]'"); $amt = sprintf("%01.2f", @current(@mysql_fetch_assoc(@mysql_query("SELECT amt_bank FROM customers_info where customers_info_id='$transaction_data[1]'")))); $amts= sprintf("%01.2f", ($amt)+$alertpay_data[16]); $UPDATE = mysql_query("UPDATE customers_info SET amt_bank='$amts' where customers_info_id = '$transaction_data[1]'");
-
Hey guys i am having a small problem i have a forme that looks like this <div id="new_link_fields0"> <div id="form_source0"> <span class="r">Nom: <input name="nom[]0"><input type="hidden" value="1" name="i[]0"> <input type="file" size="30" name="mp3[]0"><br> </span></div> <div id="form_source1"> <span class="r">Nom: <input name="nom[]1"><input type="hidden" value="1" name="i[]1"> <input type="file" size="30" name="mp3[]1"><br> </span></div> <div id="form_source2"> <span class="r">Nom: <input name="nom[]2"><input type="hidden" value="1" name="i[]2"> <input type="file" size="30" name="mp3[]2"></span></div> </div> It's auto generated so i can't change it ... I use this PHP code $i=0; foreach ($_POST[i] as $value){ $file_name = $_FILES['mp3']['name'][$i]; $file_tmp = $_FILES['mp3']['tmp_name'][$i]; echo "The file ".$file_name." is number $i<br>"; $i++; } The problem i have is even if i fill up everything i end up with this result The file djj.mp3 is number 0 The file is number 1 The file is number 2 Only the first one is taken in charge ... so i made a echo '<pre>$_POST:' . print_r($_POST,true) . '</pre>'; echo '<pre>$_FILES:' . print_r($_FILES,true) . '</pre>'; and i got $_POST:Array ( [nom] => Array ( [0] => 01 [1] => 02 [2] => 03 ) [i] => Array ( [0] => 1 [1] => 1 [2] => 1 ) [btn_name3] => Suivant ) $_FILES:Array ( [mp1] => Array ( [name] => Array ( [0] => 782718_2599_60sec.mp3 ) [type] => Array ( [0] => audio/mpeg ) [tmp_name] => Array ( [0] => /tmp/php6ALwV4 ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 724575 ) ) [mp2] => Array ( [name] => Array ( [0] => 782718_2599_60sec.mp3 ) [type] => Array ( [0] => audio/mpeg ) [tmp_name] => Array ( [0] => /tmp/phpXIXX7F ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 724575 ) ) [mp3] => Array ( [name] => Array ( [0] => 782718_2599_60sec.mp3 ) [type] => Array ( [0] => audio/mpeg ) [tmp_name] => Array ( [0] => /tmp/phpEWvorz ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 724575 ) ) ) Soe everything is uploaded but for some reason it's not working when using the vars after the first loop $file_name = $_FILES['mp3']['name'][$i]; $file_tmp = $_FILES['mp3']['tmp_name'][$i]; Any ideas? is even $_FILES['mp3']['name'][$i] working to specify what aray to use since eveything is is $_FILES['mp3']
-
bwa dlada bwa dabwaaaahaaa weee hooooo hooooo .... -> me going crazy
-
This is making me go crazy ...
-
I just made a test and $file_name = $_FILES['mp3']['name'][$i]; $file_tmp = $_FILES['mp3']['tmp_name'][$i]; Are both empty after the first loop ... any idea why?
-
It returned Modifier un albume Ajouter des MP3 $_POST:Array ( [nom] => Array ( [0] => g [1] => g [2] => g ) [i] => Array ( [0] => 1 [1] => 1 [2] => 1 ) [btn_name3] => Suivant ) $_FILES:Array ( [mp1] => Array ( [name] => Array ( [0] => 782718_2599_60sec.mp3 ) [type] => Array ( [0] => audio/mpeg ) [tmp_name] => Array ( [0] => /tmp/phpf4TEtW ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 724575 ) ) [mp2] => Array ( [name] => Array ( [0] => 782718_2599_60sec.mp3 ) [type] => Array ( [0] => audio/mpeg ) [tmp_name] => Array ( [0] => /tmp/phpI56ATf ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 724575 ) ) [mp3] => Array ( [name] => Array ( [0] => 782718_2599_60sec.mp3 ) [type] => Array ( [0] => audio/mpeg ) [tmp_name] => Array ( [0] => /tmp/phplyKobX ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 724575 ) ) ) But theres only one uploaded ... weird ... This is the full PHP code as it is right now echo '<pre>$_POST:' . print_r($_POST,true) . '</pre>'; echo '<pre>$_FILES:' . print_r($_FILES,true) . '</pre>'; $i=0; foreach ($_POST[i] as $value){ // Debug line //echo "We are taking care of $nb loops"; $file_name = $_FILES['mp3']['name'][$i]; $file_tmp = $_FILES['mp3']['tmp_name'][$i]; echo "<br><br><b>This is loop $i</b><br>"; echo "<b>The name of the file is $file_name</b><br>"; echo "<b>The var is mp3_$i</b><br><br>"; //Ici je regarde si l'extantion du code est autoriser $ext = strrchr($_FILES['mp3']['name'][$i],'.'); if (($extlimit == "OUI") && (!in_array($ext,$limitedext))) { echo "Le MP3 num $i n'a pas un extension autoriser. (mp3 seulement)<br>"; }else{ // Ici je regarde si le fichier existe déjà. if(file_exists($upload_dir.$_FILES['mp3']['name'][$i])){ $random_digit=rand(0000,9999)."_"; }else{unset($random_digit);} if (move_uploaded_file($file_tmp,$_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$random_digit.$_FILES['mp3']['name'][$i])){ chmod($_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$random_digit.$_FILES['mp3']['name'][$i], 0755); $mp3 = new mp3($upload_dir.$random_digit.$_FILES['mp3']['name'][$i]); $mp3_1 = $mp3->extract(0,30); $newname=rand("100000", "999999")."_"; $mp3_1->save($upload_demo_dir.$newname.$random_digit.$_FILES['mp3']['name'][$i]); $insert=mysql_query("INSERT INTO `distadp_adpsite`.`artiste_mp3` (id, nom_mp3, nom_demo, num_albume, nom)VALUES (NULL , '".$random_digit.$_FILES['mp3']['name'][$i]."', '".$newname.$random_digit.$_FILES['mp3']['name'][$i]."', '$_GET[id]', '".$_POST['nom'][$i]."')"); echo "<br>MP3 numéro $i uploadé! (<a href='http://distributionadp.info/admin/site/$upload_dir$random_digit".$_FILES['mp3']['name'][$i]."'>".$_FILES['mp3']['name'][$i]."</a>)<br>"; echo "Démo de 30 sec créé avec succès! (<a href='http://distributionadp.info/admin/site/$upload_demo_dir$newname$random_digit".$_FILES['mp3']['name'][$i]."'>$newname".$_FILES['mp3']['name'][$i]."</a>)<br><br>"; }else{ echo "Il ya eu une éreure inconnu dans le transfère du fichier du mp3 num $i (".$_FILES['mp3']['name'][$i].")<br>"; } } $i++; } only the first one is uploaded
-
That would probably work kenrbnsn but i really need to use the auto form generater ... take a look save this to an HTML page and open it. <script type="text/javascript"> var fields; function HTMLBlock(el) { var instance = 1, elementNames = [], i, item, container; /* remove source element */ container = el.parentNode; container.removeChild(el); /* cache input elements' name attributes */ for (i = 0; item = el.getElementsByTagName("input").item(i); i++) { elementNames[i] = item.getAttributeNode("name"); } /* method to modify and insert a clone of the original element */ this.insert = function () { for (var i = elementNames.length; i--; ) { /* replace digits with instance # */ elementNames[i].nodeValue = elementNames[i].nodeValue.replace(/\d+/, instance); } instance++; container.appendChild(el.cloneNode(true)); }; } function createHTMLBlock(id) { var d = document, el; /* test browser supports the methods we'll be using */ if (d.getElementById && (el = d.getElementById(id)) && el.getElementsByTagName && el.cloneNode && el.getAttributeNode) { /* ... etc. */ return new HTMLBlock(el); // yes } return null; // no } function addHTML() { if (fields) { fields.insert(); } } </script> <center><input type="button" onclick="addHTML()" value="Add Fields"></center><br> <div id="new_link_fields"><div id="form_source"><span class="r">Nom: <input type='text' name='nom[]' value='' size='20'><input type='hidden' name='i[]' value='1'> <input type='file' name='mp3[]' size='30'><br></span></div></div> <script type="text/javascript"> /* remove the HTML and set up the object down here, before anything's displayed */ fields = createHTMLBlock("form_source"); </script> It's a really cool script
-
Nope thats refering to <input type="hidden" value="1" name="i[]">
-
Hey guys i have a problem ... I created a javascript that auto generates form filds to upload MP3. The generated fields looks like this: <div id="new_link_fields0"> <div id="form_source0"> <span class="r">Nom: <input name="nom_0"><input type="hidden" value="1" name="i[]"> <input type="file" size="30" name="mp3_0"><br> </span></div> <div id="form_source1"> <span class="r">Nom: <input name="nom_1"><input type="hidden" value="1" name="i[]"> <input type="file" size="30" name="mp3_1"><br> </span></div> <div id="form_source2"> <span class="r">Nom: <input name="nom_2"><input type="hidden" value="1" name="i[]"> <input type="file" size="30" name="mp3_2"><br> </span></div> <div id="form_source3"> <span class="r">Nom: <input name="nom_3"><input type="hidden" value="1" name="i[]"> <input type="file" size="30" name="mp3_3"><br> </span></div> <div id="form_source4"> <span class="r">Nom: <input name="nom_4"><input type="hidden" value="1" name="i[]"> <input type="file" size="30" name="mp3_4"><br> </span></div> </div> Then i use $i=0; foreach ($_POST[i] as $value){ $file_name = $_FILES['mp3']['name'][$i]; $file_tmp = $_FILES['mp3']['tmp_name'][$i]; echo "The file ".$file_name." is number $i<br>"; } But it returns The file djj.mp3 is number 0 The file is number 1 The file is number 2 The file is number 3 The file is number 4 only the first loop is working ... what did i do wroung?
-
Yeah let me show you the complete script First i have the HTML forme. It's a Javascript that generates the feilds when pressing the add button function add_mp3_form($oups, $id){include("config.php"); print ("<tr> <td width='33%'><font size='1' face='Verdana' color='#F9B324'>Ajouter des MP3</font></td> <td width='33%' align='center'><b><font face='Verdana' size='1' color='#F9B324'></font></b></td> <td width='33%' align='right'><font face='Verdana' size='1' color='#F9B324'>Profile d'album</font></td> </tr> </table> </td> </tr> <tr> <td width='100%' bgcolor='#55BCEA' height='7'></td> </tr> <tr> <td width='100%' bgcolor='#C1CDDA'> <table border='0' cellpadding='3' cellspacing='3' style='border-collapse: collapse' bordercolor='#111111' width='100%' id='AutoNumber4'> <tr> <td width='100%'> <table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='602' id='AutoNumber6' height='22'><form name='etape3' method='POST' action='catalogue.php?mod=13&id=$id&send=1' enctype='multipart/form-data'> <tr> <td width='602' height='22' colspan='2'> <font face='Verdana' size='1' color='#FF0000'>$oups</font></td> </tr><tr> <td width='20%' colspan='2' height='22'>"); ?> <script type="text/javascript"> var fields; function HTMLBlock(el) { var instance = 1, elementNames = [], i, item, container; /* remove source element */ container = el.parentNode; container.removeChild(el); /* cache input elements' name attributes */ for (i = 0; item = el.getElementsByTagName("input").item(i); i++) { elementNames[i] = item.getAttributeNode("name"); } /* method to modify and insert a clone of the original element */ this.insert = function () { for (var i = elementNames.length; i--; ) { /* replace digits with instance # */ elementNames[i].nodeValue = elementNames[i].nodeValue.replace(/\d+/, instance); } instance++; container.appendChild(el.cloneNode(true)); }; } function createHTMLBlock(id) { var d = document, el; /* test browser supports the methods we'll be using */ if (d.getElementById && (el = d.getElementById(id)) && el.getElementsByTagName && el.cloneNode && el.getAttributeNode) { /* ... etc. */ return new HTMLBlock(el); // yes } return null; // no } function addHTML() { if (fields) { fields.insert(); } } </script> <center><input type="button" onclick="addHTML()" value="Add Fields"></center><br> <div id="new_link_fields"><div id="form_source"><span class="r">Nom: <input type='text' name='nom[]' value='' size='20'><input type='hidden' name='i[]' value='1'> <input type='file' name='mp3[]' size='30'><br></span></div></div> <script type="text/javascript"> /* remove the HTML and set up the object down here, before anything's displayed */ fields = createHTMLBlock("form_source"); </script> <?php print ("</td> </tr></table> </td> </tr> </table> </td> </tr> <tr> <td width='100%' bgcolor='#C1CDDA'> <table border='0' cellpadding='3' cellspacing='3' style='border-collapse: collapse' bordercolor='#111111' width='100%' id='AutoNumber5'> <tr> <td width='100%'> <input type='submit' value='Suivant' name='btn_name3' style='float: right'></td></form> </tr> </table> </td> </tr>"); } And this is the PHP code that takes the result in charge foreach ($_POST["mp3"] as $i=>$mp3) { $nom = $_POST["nom"][$i]; // Debug line //echo "We are taking care of $nb loops"; $file_name = $mp3['name']; $file_tmp = $mp3['tmp_name']; echo "<br><br><b>This is loop $i</b><br>"; echo "<b>The name of the file is $file_name</b><br>"; echo "<b>The var is mp3_$i</b><br><br>"; //Ici je regarde si l'extantion du code est autoriser $ext = strrchr($mp3['name'],'.'); if (($extlimit == "OUI") && (!in_array($ext,$limitedext))) { echo "Le MP3 num $i n'a pas un extension autoriser. (mp3 seulement)<br>"; }else{ // Ici je regarde si le fichier existe déjà. if(file_exists($upload_dir.$mp3['name'])){ $random_digit=rand(0000,9999)."_"; }else{unset($random_digit);} if (move_uploaded_file($file_tmp,$_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$random_digit.$mp3['name'])){ chmod($_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$random_digit.$mp3['name'], 0755); $mp3 = new mp3($upload_dir.$random_digit.$mp3['name']); $mp3_1 = $mp3->extract(0,30); $newname=rand("100000", "999999")."_"; $mp3_1->save($upload_demo_dir.$newname.$random_digit.$mp3['name']); $insert=mysql_query("INSERT INTO `distadp_adpsite`.`artiste_mp3` (id, nom_mp3, nom_demo, num_albume, nom)VALUES (NULL , '".$random_digit.$mp3['name']."', '".$newname.$random_digit.$mp3['name']."', '$_GET[id]', '$nom')"); echo "<br>MP3 numéro $i uploadé! (<a href='http://distributionadp.info/admin/site/$upload_dir$random_digit".$mp3['name']."'>".$mp3['name']."</a>)<br>"; echo "Démo de 30 sec créé avec succès! (<a href='http://distributionadp.info/admin/site/$upload_demo_dir$newname$random_digit".$mp3['name']."'>$newname".$mp3['name']."</a>)<br><br>"; }else{ echo "Il ya eu une éreure inconnu dans le transfère du fichier du mp3 num $i (".$mp3['name'].")<br>"; } } } print ('<embed hidden=true loop=false src="http://distributionadp.info/s.mp3"></embed> <meta http-equiv="refresh" content="10;url=http://distributionadp.info/admin/site/catalogue.php?mod=12&id='.$_GET[id].'"> </td> </tr> </table> </td> </tr>'); }else{ add_mp3_form($err, $_GET[id]); } } The current foeach sugested returns and error Warning: Invalid argument supplied for foreach() in catalogue.php on line 1067
-
Hey guys i am trying to get 2 form arrays tot to work at the same time in a foreach. I tryed a few things but nothing is working. foreach ($_POST["mp3"] as $mp3 and $_POST["nom"] as $nom) { foreach ($_POST["mp3"] as $mp3, $_POST["nom"] as $nom) {
-
Hey guys i am having a problem making an upload script where you can click on a button and it adds a new form field. That part works well but the PHP scrip handling them returns emtpy stuff. <form name='etape3' method='POST' action='catalogue.php?mod=13&id=$id&send=1' enctype='multipart/form-data'> <script type="text/javascript"> var fields; function HTMLBlock(el) { var instance = 1, elementNames = [], i, item, container; /* remove source element */ container = el.parentNode; container.removeChild(el); /* cache input elements' name attributes */ for (i = 0; item = el.getElementsByTagName("input").item(i); i++) { elementNames[i] = item.getAttributeNode("name"); } /* method to modify and insert a clone of the original element */ this.insert = function () { for (var i = elementNames.length; i--; ) { /* replace digits with instance # */ elementNames[i].nodeValue = elementNames[i].nodeValue.replace(/\d+/, instance); } instance++; container.appendChild(el.cloneNode(true)); }; } function createHTMLBlock(id) { var d = document, el; /* test browser supports the methods we'll be using */ if (d.getElementById && (el = d.getElementById(id)) && el.getElementsByTagName && el.cloneNode && el.getAttributeNode) { /* ... etc. */ return new HTMLBlock(el); // yes } return null; // no } function addHTML() { if (fields) { fields.insert(); } } </script> <center><input type="button" onclick="addHTML()" value="Add Fields"></center><br> <div id="new_link_fields"><div id="form_source"><span class="r">Nom: <input type='text' name='nom[]' value='' size='20'><input type='hidden' name='i[]' value='1'> <input type='file' name='mp3[]' size='30'><br></span></div></div> <script type="text/javascript"> /* remove the HTML and set up the object down here, before anything's displayed */ fields = createHTMLBlock("form_source"); </script> </form> The php stuff i use foreach ($_POST["mp3"] as $eachInput) {$nb++;} // Debug line //echo "We are taking care of $nb loops"; for($i=0; $i != $nb ; $i++) { $file_name = $_FILES['mp3_'.$i]['name']; $file_tmp = $_FILES['mp3_'.$i]['tmp_name']; echo "<br><br><b>This is loop $i</b><br>"; echo "<b>The name of the file is $file_name</b><br>"; echo "<b>The var is mp3_$i</b><br><br>"; //Ici je regarde si l'extantion du code est autoriser $ext = strrchr($_FILES['mp3_'.$i]['name'],'.'); if (($extlimit == "OUI") && (!in_array($ext,$limitedext))) { echo "Le MP3 num $i n'a pas un extension autoriser. (mp3 seulement)<br>"; }else{ // Ici je regarde si le fichier existe déjà. if(file_exists($upload_dir.$_FILES['mp3_'.$i]['name'])){ $random_digit=rand(0000,9999)."_"; }else{unset($random_digit);} if (move_uploaded_file($file_tmp,$_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$random_digit.$_FILES['mp3_'.$i]['name'])){ chmod($_SERVER['DOCUMENT_ROOT']."/admin/site/".$upload_dir.$random_digit.$_FILES['mp3_'.$i]['name'], 0755); $mp3 = new mp3($upload_dir.$random_digit.$_FILES['mp3_'.$i]['name']); $mp3_1 = $mp3->extract(0,30); $newname=rand("100000", "999999")."_"; $mp3_1->save($upload_demo_dir.$newname.$random_digit.$_FILES['mp3_'.$i]['name']); $insert=mysql_query("INSERT INTO `distadp_adpsite`.`artiste_mp3` (id, nom_mp3, nom_demo, num_albume, nom)VALUES (NULL , '".$random_digit.$_FILES['mp3_'.$i]['name']."', '".$newname.$random_digit.$_FILES['mp3_'.$i]['name']."', '$_GET[id]', '".$_POST['nom_'.$i]."')"); echo "<br>MP3 numéro $i uploadé! (<a href='http://distributionadp.info/admin/site/$upload_dir$random_digit".$_FILES['mp3_'.$i]['name']."'>".$_FILES['mp3_'.$i]['name']."</a>)<br>"; echo "Démo de 30 sec créé avec succès! (<a href='http://distributionadp.info/admin/site/$upload_demo_dir$newname$random_digit".$_FILES['mp3_'.$i]['name']."'>$newname".$_FILES['mp3_'.$i]['name']."</a>)<br><br>"; }else{ echo "Il ya eu une éreure inconnu dans le transfère du fichier du mp3 num $i (".$_FILES['mp3_'.$i]['name'].")<br>"; } } } And this script returns this This is loop 0 The name of the file is The var is mp3_0 Le MP3 num 0 n'a pas un extension autoriser. (mp3 seulement) This is loop 1 The name of the file is The var is mp3_1 Le MP3 num 1 n'a pas un extension autoriser. (mp3 seulement) This is loop 2 The name of the file is The var is mp3_2 Le MP3 num 2 n'a pas un extension autoriser. (mp3 seulement) The name of the files are empty so it's obviously not taking care of the uploaded stuff ... Any help on this would be greatly appreciated