Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Problem sa Picture Uplodom...

[es] :: PHP :: Problem sa Picture Uplodom...

[ Pregleda: 2014 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

01011011

Član broj: 561
Poruke: 2341
12.159.232.*



+2 Profil

icon Problem sa Picture Uplodom...22.06.2005. u 18:11 - pre 212 meseci
evo koda..

Code:

    <form enctype="multipart/form-data" action="addpicture.php" method="post">

                Select Photo<br />
                <input type="file" name="upfile"> <p>
                <input type="image" src="submit.jpg" border="0" name="submit"> 
                <input type="hidden" name="cat_id" value="<?php echo $row['cat_id']; ?>">
                <input type="hidden" name="page" value="<?php echo $page; ?>">
                <? 



ovo je prvi djelic koda a drugi je ovo

Code:

if ((isset ($_POST['submit'])) || (isset($_POST['submit_x'])))
            {
                include "db_connect.php";
                
                $result = mysql_query("select * from  categories where cat_id ='{$_POST["cat_id"]}'") or 
                                    die (mysql_error());
                        
                        $row = mysql_fetch_assoc($result); 
                        $category = $row["cat_title"];
                $gallery = "/home/r4334/public_html/vfaPublishing/gallery/";
                $upload_dir1 = $gallery . $category;
                $upload_dir = $upload_dir1 . "/";

                if (move_uploaded_file($_FILES['upfile']['tmp_name'], $upload_dir . $_FILES['upfile']['name']))
                {
                    $title = $_FILES['upfile']['name'];
                    echo $title;
                
                    $huh = $_POST['upfile'];

                    $poss=strrpos($huh,"/");
                    $huhs=substr($huh,$poss+1);

                    //INSERT INTO `images` ( `image_id` , `cat_id` , `image_title` , `image_url` ) VALUES ('', '2', 'sdf', 'ads');

                    $query = mysql_query("INSERT INTO `images` ( `image_id` , `cat_id` , `image_title` , `image_url` ) VALUES ('', '{$_POST["cat_id"]}', '$huhs', '$poss')") or 
                    die (mysql_error());
                
                    $page = $_POST["page"];
                }
                else
                {
                    echo "DAMN IT";
                }



ima dosta stvari koje sam jos kod obradjivanja uradio...
Sta mi nije jasno i error koji dobijam je sledeci..

Code:


Warning: move_uploaded_file(/home/r4334/public_html/vfaPublishing/gallery/Waterfalls Gallery/12.JPG): failed to open stream: Permission denied in /home/r4334/public_html/admin/addpicture.php on line 62

Warning: move_uploaded_file(): Unable to move '/tmp/phpdOAptS' to '/home/r4334/public_html/vfaPublishing/gallery/Waterfalls Gallery/12.JPG' in /home/r4334/public_html/admin/addpicture.php on line 62
DAMN IT


gallery folder mi je chomd-ovan na 777 i ne vidim razlog zasto nece da pise po njemu?

Da li neko ima predlog.
 
Odgovor na temu

luka357
Banja Luka

Član broj: 16848
Poruke: 34
*.nezavisne.com.



Profil

icon Re: Problem sa Picture Uplodom...22.06.2005. u 18:25 - pre 212 meseci
Probaj da folderu Waterfalls Gallery omogucis pisanje (777)
 
Odgovor na temu

01011011

Član broj: 561
Poruke: 2341
12.159.232.*



+2 Profil

icon Re: Problem sa Picture Uplodom...22.06.2005. u 18:43 - pre 212 meseci
Huh, vidis da sam pogresio razmisljam o gallery folderu a ne o waterfalls..

sorry,

skinuo sam sad permission denied, znaci omogucio sam tom folderu da ima pristupacnost, ali sad imam drugi error:

Code:

Warning: move_uploaded_file(/home/r4334/public_html/public_html/vfaPublishing/gallery/Waterfalls Gallery/12.JPG): failed to open stream: No such file or directory in /home/r4334/public_html/admin/addpicture.php on line 63

Warning: move_uploaded_file(): Unable to move '/tmp/phpIXAmcb' to '/home/r4334/public_html/public_html/vfaPublishing/gallery/Waterfalls Gallery/12.JPG' in /home/r4334/public_html/admin/addpicture.php on line 63
DAMN IT


E sad ne kontam, mora da mi je path sjeban al ne kontam kako, evo koji mi je sada path...

Code:

$gallery =  $_SERVER['DOCUMENT_ROOT'] . "/public_html/vfaPublishing/gallery/";
                $upload_dir1 = $gallery . $category;
                $upload_dir = $upload_dir1 . "/";

                if (move_uploaded_file($_FILES['upfile']['tmp_name'], $upload_dir . $_FILES['upfile']['name']))
                {
                    $title = $_FILES['upfile']['name'];
                    echo $title;


Sta sad ovdje nije u redu???
 
Odgovor na temu

01011011

Član broj: 561
Poruke: 2341
12.159.232.*



+2 Profil

icon Re: Problem sa Picture Uplodom...22.06.2005. u 19:00 - pre 212 meseci
Glupa greska :(

Code:

4334/public_html/public_html/v



Dva puta public_html

 
Odgovor na temu

[es] :: PHP :: Problem sa Picture Uplodom...

[ Pregleda: 2014 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.