set_time_limit() error

Gestart doorMarvinn4 reacties60 weergaven

5 berichten · pagina 1 van 1

Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi.

Ik snap deze fout niet:

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/nickjexx/domains/habbotjes.be/public_html/upload.php on line 27

Weet iemand hoe je die fixt? De code:
Spoiler tonen
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Uploaden!</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="all">
        <div class="header"><img alt="upload" style="margin-top: 20px; margin-left: 50px;" src="css/images/upload.gif" /></div>
        <div class="content">
            <table>
                <tr>
                    <td>
                    </td>
                    <td>
                        
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]//verander de onderstaande gegevens [/COLOR]

[COLOR= #0000BB]$locatie[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"uploads/"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//of een andere map, vergeet niet de w-rechten [/COLOR]
[COLOR= #0000BB]$toegestaan[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"jpg, gif, png, jpeg, bmp, PNG"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// extensies die toegestaan zijn [/COLOR]
[COLOR= #0000BB]$max_size[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]747030[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//maximale grootte van het bestand in bytes

//stop met veranderen [/COLOR]

[URL="http://www.php.net/set_time_limit"]set_time_limit[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR] 

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]upload[/COLOR][COLOR= #007700]])) 
{[/COLOR] 
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/is_uploaded_file"]is_uploaded_file[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]tmp_name[/COLOR][COLOR= #007700]])) 
{[/COLOR] 
[COLOR= #0000BB]$extensie_bestand[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/pathinfo"]pathinfo[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]);[/COLOR] 
[COLOR= #0000BB]$extensie_bestand[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$extensie_bestand[/COLOR][COLOR= #007700][[/COLOR]extension[COLOR= #007700]];[/COLOR] 

[COLOR= #0000BB]$extensies_toegestaan[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$toegestaan[/COLOR][COLOR= #007700]);[/COLOR] 

[URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$extensies_toegestaan[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++) 
{[/COLOR] 
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$extensies_toegestaan[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"$extensie_bestand"[/COLOR][COLOR= #007700]) 
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]uploads/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Er bestaat al een bestand met die naam."[/COLOR][COLOR= #007700]);
}[/COLOR]

[COLOR= #0000BB]$ok[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]; 
} 
}[/COLOR] 

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ok[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) 
{[/COLOR] 
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]size[/COLOR][COLOR= #007700]]>[/COLOR][COLOR= #0000BB]$max_size[/COLOR][COLOR= #007700]) 
{[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het bestand is te groot, de maximale grootte is: <b>$max_size</b>"[/COLOR][COLOR= #007700];[/COLOR] 
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]; 
}[/COLOR] 



[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/move_uploaded_file"]move_uploaded_file[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]tmp_name[/COLOR][COLOR= #007700]],[/COLOR] 
[COLOR= #0000BB]$locatie[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]])) 
{[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"het bestand kan niet worden verplaatst"[/COLOR][COLOR= #007700];[/COLOR] 
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]; 
}[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het bestand "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" is geupload<br> 
<a href="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$locatie[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" target=_blank>Klik hier om het te bekijken</a></td>"[/COLOR][COLOR= #007700]; 
}[/COLOR] 
[URL="http://www.php.net/else"]else[/URL] 
[COLOR= #007700]{[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Verkeerde extentie, de toegestane extensies zijn: <b>$toegestaan</b> *NEEM CONTACT MET NICKJEXX OP!*"[/COLOR][COLOR= #007700]; 
} 
}[/COLOR] 
[URL="http://www.php.net/else"]else[/URL] 
[COLOR= #007700]{[/COLOR] 
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het uploaden is mislukt *NEEM CONTACT MET NICKJEXX OP!*"[/COLOR][COLOR= #007700]; 
} 

}[/COLOR] 

?>
<form method="post" action="<?=$_SERVER[PHP_SELF]?>" enctype="multipart/form-data"> 
<input type="file" name="bestand"><br> 
<input type="submit" name="upload" value="Upload!"> 
</form>
                    </td>
                </tr>
                <tr>
                   
                    </td>
                    <td style="border-top: 1px solid #000000; font-weight: normal;">
                    
                    </td>
                </tr>
            </table>
        </div>
    </div>
</body>
</html>
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Neem contact op met je hoster.
safe_mode staat aan in PHP dus is die functie uitgeschakeld.
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nou Lennard als je het leest yummie (Ik zit namelijk op one2xs (Server 1))
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Of je haalt die regel gewoon weg. De default tijd staat op 60 seconden geloof ik. Als het uploaden langer dan dat duurt dan doe je volgens mij wel iets fout.

Overigens gaan ze safe-mode niet uitzetten denk ik. In een shared omgeving neemt dat veel gevaar met zich mee.
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het heeft er nooit gestaan xD?
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren