Fout met class;(

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Manaus

Manaus

02/02/2007 10:30:00
Quote Anchor link
Waarom upload hij de movie niet?:(
Ik probeer hier vanalles maar hij blijft niet werken:@
Heeft er iemadn een idee ?:D
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
if($_REQUEST[action_upload]!="")
{

        if($_REQUEST[field_myvideo_title]==""){
            $err="Upload: Please Provide a video title.";
        }

        elseif($_REQUEST[field_myvideo_descr]==""){
            $err="Upload: Please Provide a video description.";
        }

        elseif($_REQUEST[field_myvideo_keywords]==""){
            $err="Upload: Please provide tag/s.";
        }

        elseif(count($_REQUEST[chlist])<1 || count($_REQUEST[chlist])>3){
            $err="Upload: Please check (1 to 3) channel/s.";
        }


        if($err==""){
            $page = "second";
            STemplate::assign('secondpage',"second");
            $listch=implode("|",$_REQUEST[chlist]);
            STemplate::assign('listch',$listch);
            $var = "<script language=javascript>
                    var field_myvideo_title = $_REQUEST[field_myvideo_title];
                    var field_myvideo_descr = $_REQUEST[field_myvideo_descr];
                    var field_myvideo_keywords = $_REQUEST[field_myvideo_keywords];
                    var listch = $listch;
                    </script>"
;
            STemplate::assign("var", $var);
        }
}

if($_POST[upload_final]!="")
{

        if($_FILES['field_uploadfile']['tmp_name']=="") $err="Please provide the video location.";
        if($err=="" && $_FILES['field_uploadfile']['tmp_name']!="")
                {

                $p=$_FILES['field_uploadfile']['name'];
                $pos=strrpos($p,".");
                $ph=strtolower(substr($p,$pos+1,strlen($p)-$pos));
                /* Space in Megabytes (MB) */
                $space = round($_FILES['field_uploadfile']['size']/(1024*1024));
                if($config['enable_package']=="yes")
                {

                        check_subscriber($space);
                }

                
                if(($ph!="mpg" && $ph!="avi" && $ph!="mpeg" && $ph!="wmv" && $ph!="rm" && $ph!="dat") || $space>$config[max_video_size])
                $err="Invalid Video Format.";
                }


        if($err=="")
        {

                $sql="insert into video set
                        UID=$_SESSION[UID],
                        title='$_REQUEST[field_myvideo_title]',
                        description='$_REQUEST[field_myvideo_descr]',
                        keyword='$_REQUEST[field_myvideo_keywords]',
                        channel='0|$_REQUEST[listch]|0',
                        space = '$_REQUEST[space]',
                        addtime='"
.time()."',
                        adddate='"
.date("Y-m-d")."',
                        vkey='"
.mt_rand()."',
                        type='$_REQUEST[field_privacy]',
                        filehome='$_REQUEST[p]'"
;
                $conn->execute($sql);
                $vid=mysql_insert_id();
                $vdoname=$vid.".".$ph;
            
                    if(isset($_FILES['field_uploadfile']['tmp_name']) && is_uploaded_file($_FILES['field_uploadfile']['tmp_name']))
                    {

                        $ff = $config[vdodir]."/".$vdoname;
                        if(move_uploaded_file($_FILES['field_uploadfile']['tmp_name'], $ff))
                        {
    $mov = new ffmpeg_movie($ff);
                            video_to_frame($ff,$vid,&$mov,$listch[0]);
                            $duration=$mov->getDuration();
                            exec("$config[ffmpeg] -i $config[vdodir]/$vdoname -acodec mp3 -ar 22050 -ab 32 -f flv $config[flvdodir]/".$vid.".flv");
                        }
                      
                    }

                //END

                $key=substr(md5($vid),11,20);
                $sql="update video set
                        vdoname='$vdoname',
                        flvdoname='"
.$vid.".flv',
                        duration='$duration',
                        vkey='$key' WHERE VID=$vid"
;
                $conn->execute($sql);
        
                if($config['enable_package']=="yes")
                {

                        $sql = "update subscriber set used_space=used_space+$space, used_bw=used_bw+$space, total_video=total_video+1 where UID=$_SESSION[UID]";
                        $conn->execute($sql);
                }

        
                header("Location:$config[baseurl]/upload_success.php?viewkey=$key&upload=yes&vid=$vid");
        }
}

?>
Gewijzigd op 01/01/1970 01:00:00 door Manaus
 
PHP hulp

PHP hulp

20/11/2024 00:23:50
 
- wes  -

- wes -

02/02/2007 10:31:00
Quote Anchor link
$_REQUEST[action_upload]!="")

tenzij je action_upload hebt gedefined, moet het met quotejes
overal door je script hetzelfde
 
Manaus

Manaus

02/02/2007 10:48:00
Quote Anchor link
nja daar ligt het niet aan, hij zegt telkens dat het een invalid videoformat is terwijl het niet zo is:(

Fatal error: Cannot instantiate non-existent class: ffmpeg_movie in /home/piemel/domains/chat.neonhosting.org/public_html/upload.php on line 82

Het gaat dus om deze regel:
if(move_uploaded_file($_FILES['field_uploadfile']['tmp_name'], $ff))
Gewijzigd op 01/01/1970 01:00:00 door Manaus
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.