JazMan Posted June 16, 2005 Report Share Posted June 16, 2005 Man palaik ir uztaisiits taa , ka failu ieladei atveras jauns logs, ka var uztaisit taa, lai pec veiksmigas faila ielades galvenaa loga formas laukaaa tiktu ievietota vertiba (faila nosaukums). Varbut kadam ir kads skripts? :rolleyes: :unsure: Link to comment Share on other sites More sharing options...
bubu Posted June 16, 2005 Report Share Posted June 16, 2005 Ja der javaskripts, tad var ar atvērtā loga mainīt atverēja loga dokumenta laukus: top.opener.documen.forms[0].lauks_name.value="vērtība"; Link to comment Share on other sites More sharing options...
JazMan Posted June 16, 2005 Author Report Share Posted June 16, 2005 Lieta tada ka failu ielade notiek vienaa loga, bet forma otrajaaa, un kadaa veidaaa var uztaisit taa ka tiko ieladetaa faila nosaukumu pievienot formas laukam :blink: Link to comment Share on other sites More sharing options...
bubu Posted June 16, 2005 Report Share Posted June 16, 2005 Nu ja no tā loga, kurā ir forma tiek atvērts tas augšupielādes logs ar window.open palīdzību, tad tas kods ko iepriekš uzrakstīju tev derēs. Link to comment Share on other sites More sharing options...
Kristabs Posted June 16, 2005 Report Share Posted June 16, 2005 (edited) Lieta tada ka failu ielade notiek vienaa loga, bet forma otrajaaa, un kadaa veidaaa var uztaisit taa ka tiko ieladetaa faila nosaukumu pievienot formas laukam :blink: 18587[/snapback] echo "<input name=\"vards\" type=\"hidden\" value=\"{$vertiba}\">"; pievieno sleeptos laukumus formai un pousto uz priekshu UPD:ups, te laikam pavisam par ko citu runa Edited June 16, 2005 by Kristabs Link to comment Share on other sites More sharing options...
Gizmo Posted June 21, 2005 Report Share Posted June 21, 2005 (edited) <?php include ("conn.php"); $uploaddir = 'uploads/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); print "<pre>"; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { $basename = ($_FILES['userfile']['name']); $bilde = $basename; if (empty($cena)) { print ("Nesaņēmu cenu!<br>"); } elseif (empty($izmers)) { print ("Nesaņēmu izmēru!<br>"); } else { $result = @mysql_query("insert into gleznas values(null,'$bilde','$cena','$izmers')"); @mysql_free_result('$result'); echo "<script language=\"javascript\">location='m.php'</script>"; } } else { print "Kautkas nesanāca:\n"; print_r($_FILES); } print "</pre>"; ?> Uz localhost viss bija O.K., bet uz servera izdrukaa: Warning: move_uploaded_file(uploads/IMGP1202.jpg): failed to open stream: Permission denied in /home/hosting/interjers/upload2.php on line 7 Warning: move_uploaded_file(): Unable to move '/tmp/phpKe49em' to 'uploads/IMGP1202.jpg' in /home/hosting/interjers/upload2.php on line 7 Kautkas nesanāca: Array ( [userfile] => Array ( [name] => IMGP1202.jpg [type] => image/pjpeg [tmp_name] => /tmp/phpKe49em [error] => 0 [size] => 77526 ) ) Kas pa vainu? Edited June 21, 2005 by Gizmo Link to comment Share on other sites More sharing options...
Venom Posted June 21, 2005 Report Share Posted June 21, 2005 Permission denied - uz linuks servera nav uzliktas att. rakstīšanas tiesības auz direktoriju. taisi chmod 0755 Link to comment Share on other sites More sharing options...
Gizmo Posted June 21, 2005 Report Share Posted June 21, 2005 aha, viss skaidrs liidz chmod 0755 Link to comment Share on other sites More sharing options...
Venom Posted June 21, 2005 Report Share Posted June 21, 2005 vai nu ar php chmod($directory,0755), vai komandrindā to pašu bet ar atstarpēm (sk chmod --help vai ko tml) Link to comment Share on other sites More sharing options...
Kristabs Posted June 21, 2005 Report Share Posted June 21, 2005 aha, viss skaidrs liidz chmod 0755 18668[/snapback] komandliinijaa chmod -R 777 /home/hosting/interjers/uploads Link to comment Share on other sites More sharing options...
Gizmo Posted June 22, 2005 Report Share Posted June 22, 2005 Nekas nesanāk :( Warning: chmod(): Operation not permitted in /home/hosting... Link to comment Share on other sites More sharing options...
Venom Posted June 22, 2005 Report Share Posted June 22, 2005 tad roši vien jāprasa hostinga turētājam, lai uzliekt tev tiesības vai iedod att. chown Link to comment Share on other sites More sharing options...
Gizmo Posted July 5, 2005 Report Share Posted July 5, 2005 O.K. dabūju pieeju servera administrēsanai caur WEB, kur atrodas config fails un kas tur jaapamaina? Apache2 Link to comment Share on other sites More sharing options...
Venom Posted July 6, 2005 Report Share Posted July 6, 2005 admin. caur web? vispār jau vajadzēja ne Apacim klāt (httpd.conf), bet failu sistēmas tiesībām tikt klāt, however varbūt apacim lietotāju pamainīja, tagad no php <?php chmod('fails',0755); ?> kļūdu vēl met? Link to comment Share on other sites More sharing options...
Gizmo Posted July 6, 2005 Report Share Posted July 6, 2005 Sorry, kautkas nesanāk, kur lai iisti ievieto to chmod? Un ko apziimee 'fails' ? Tas tak nau jaaliek jau formaa? <?php include ("conn.php"); $uploaddir = 'uploads/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); print "<pre>"; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { $basename = ($_FILES['userfile']['name']); $bilde = $basename; if (empty($cena)) { print ("Nesaņēmu cenu!<br>"); } elseif (empty($izmers)) { print ("Nesaņēmu izmēru!<br>"); } else { $result = @mysql_query("insert into gleznas values(null,'$bilde','$cena','$izmers')"); @mysql_free_result('$result'); echo "<script language=\"javascript\">location='m.php'</script>"; } } else { print "Kautkas nesanāca:\n"; print_r($_FILES); } print "</pre>"; ?> Link to comment Share on other sites More sharing options...
Recommended Posts