e pus de 2 ori ...imi cer scuze da la incepatori nu am rezolvat problema..poate aici ....HELP ME PLS!!!
Conform codului de mai jos datele sunt introduse in baza de date separat o data numle pozei si di link-ul si apoi datele ...dar eu vteau toate o singura data si sa-i coresunda un singur ID
poate cineva sa ma ajute va rog
code: <?php
$name = $_POST['name'];
$name = trim($name);
$name=strip_tags($name);
$name = str_replace(" ","",$name);
$name=str_replace("%20","",$name);
$name=addslashes($name);
// Where the file is going to be placed temporarly
$target_path = "tmp_poze/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$_FILES['uploadedfile']['tmp_name']; // temp file
$target_path = "poze/";
$oldfile = basename($_FILES['uploadedfile']['name']);
// getting the extention
$pos = strpos($oldfile,".",0);
$ext = trim(substr($oldfile,$pos+1,strlen($oldfile))," ");
function generate($length=8)
{
$key="";
$num_array = ("123456789");
for($i=0; $i<$length; $i++)
{
mt_srand((double)microtime()*1000000);
$randNum=mt_rand(0,8);
$key.=$num_array[$randNum];
}
return $key;
}
$tm=generate();
//new file name example for a profile image of a user
$newfile = $name ."_" . $tm . "." . $ext;
// move the file to the final destination
$target_path = $target_path . basename($newfile);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "Fisierul ". basename( $_FILES['uploadedfile']['name']). " a fost adugat!";
$sql = "INSERT INTO formular SET name='$name' , dir='$target_path'";
mysql_query($sql) or die(mysql_error());
} else{
echo "EROARE... incearca din nou!";
}
$_SESSION['nume'] = $_POST['nume'];
$_SESSION['prenume'] = $_POST['prenume'];
$_SESSION['nanterior'] = $_POST['nanterior'];
$_SESSION['cetatenie'] = $_POST['cetatenie'];
$_SESSION['starecivila'] = $_POST['starecivila'];
$_SESSION['name'] = $_POST['name'];
$_SESSION['dir'] = $_POST['target_path'];
UPLOAD --- PLS HELP - [REZOLVAT]
Moderatori: coditza, Emil, Moderatori
UPLOAD --- PLS HELP - [REZOLVAT]
Ultima oară modificat Vin Aug 24, 2007 8:06 am de către Pushtiu, modificat 1 dată în total.
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 7 vizitatori

