Uploadscript

Gestart doorJvdw15 reacties44 weergaven

16 berichten · pagina 1 van 2

Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi, ik zoek een simpel uploadscript dat volgende dingen kan.
- Plaatjes uploaden (duhemo)
- De afbeeldinglink moet hetzelfde zijn als de afbeeldingnaam. (dus geen link met 100cijfers.)
- Meldingen wanneer plaatje te groot is, verkeerde extentie, naam al ingebruikt, etc..

Je mag zelf een maken of een googlen. Prijs valt te besprekenshiny
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ergens in webwereld had iemand er eentje gepost die hijgemaakt had,het is wel ff zoeken want ik heb er ook al naar gezocht
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$locatie[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"uploads/"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//of een andere map, vergeet niet de 777-rechten[/COLOR]
[COLOR= #0000BB]$toegestaan[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"jpg"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"gif"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"png"[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// extensies die toegestaan zijn[/COLOR]
[COLOR= #0000BB]$max_size[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]150000[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//maximale grootte van het bestand in bytes /1024 = kb /1024 = mb[/COLOR]
[COLOR= #0000BB]$jousite[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"http://www.jouwdomein.nl/"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// eindigent op een slash
 
//stop met veranderen[/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]
 
        [COLOR= #0000BB]$ok[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$extensie_bestand[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$toegestaan[/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>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$max_size[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</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= #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><br />De link is : "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$jousite[/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/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Verkeerde extentie, de toegestane extensies zijn: <b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$toegestaan[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</b>"[/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"[/COLOR][COLOR= #007700];
    }
 
}[/COLOR]
?>
<br />
<form method="post" action="" enctype="multipart/form-data">
<input type="file" name="bestand" /><br />
<input type="submit" name="upload" value="Uploaden!" />
</form>


Wat krijg ik ervoor? het liefst 0,1...
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jellesch schreef:
Eerdere citaten tonen
Maartenl schreef:
Wat kan jij goed scripten emo
http://www.sitemasters.be/scripts/1/14/765/PHP/Upload_V1.1

Mag toch ook van google staat er....
Lees het topic eens goed door...
jouwe werkt tochnie
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Jvdw schreef:
Eerdere citaten tonen
Jellesch schreef:
Eerdere citaten tonen
Maartenl schreef:
Wat kan jij goed scripten emo
http://www.sitemasters.be/scripts/1/14/765/PHP/Upload_V1.1

Mag toch ook van google staat er....
Lees het topic eens goed door...
jouwe werkt tochnie
werkt wel hoor.
gebruik hem zelf ook.
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jellesch schreef:
Eerdere citaten tonen
Jvdw schreef:
Eerdere citaten tonen
Jellesch schreef:
Eerdere citaten tonen
Maartenl schreef:
Wat kan jij goed scripten emo
http://www.sitemasters.be/scripts/1/14/765/PHP/Upload_V1.1

Mag toch ook van google staat er....
Lees het topic eens goed door...
jouwe werkt tochnie
werkt wel hoor.
gebruik hem zelf ook.
ja nu werkt hij, maar hij overschrijft afbeeldingen die al bestaatconfused
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jvdw schreef:
Eerdere citaten tonen
Jellesch schreef:
Eerdere citaten tonen
Jvdw schreef:
Eerdere citaten tonen
Jellesch schreef:
Eerdere citaten tonen
Maartenl schreef:
Wat kan jij goed scripten emo
http://www.sitemasters.be/scripts/1/14/765/PHP/Upload_V1.1

Mag toch ook van google staat er....
Lees het topic eens goed door...
jouwe werkt tochnie
werkt wel hoor.
gebruik hem zelf ook.
ja nu werkt hij, maar hij overschrijft afbeeldingen die al bestaatconfused
Kan je controleren door if(file_exists("HET BESTAND"))
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik ken nix van phpbloosbloos
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Jvdw schreef:
ik ken nix van phpbloosbloos
Basis???
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$locatie[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"uploads/"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//of een andere map, vergeet niet de 777-rechten[/COLOR]
[COLOR= #0000BB]$toegestaan[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"jpg"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"gif"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"png"[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// extensies die toegestaan zijn[/COLOR]
[COLOR= #0000BB]$max_size[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]150000[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//maximale grootte van het bestand in bytes /1024 = kb /1024 = mb[/COLOR]
[COLOR= #0000BB]$jousite[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"http://www.jouwdomein.nl/"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// eindigent op een slash
 
//stop met veranderen[/COLOR]
 
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] TRUE[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]
 
[COLOR= #0000BB]$ok[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$extensie_bestand[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$toegestaan[/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][URL="http://www.php.net/file_exists"]file_exists[/URL][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]"Er bestaat al een bestand met deze naam!"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][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>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$max_size[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</b>"[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/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/else"]else[/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= #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><br />De link is : "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$jousite[/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/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Verkeerde extentie, de toegestane extensies zijn: <b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$toegestaan[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</b>"[/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"[/COLOR][COLOR= #007700];
}
 
}[/COLOR]
?>
<br />
<form method="post" action="" enctype="multipart/form-data">
<input type="file" name="bestand" /><br />
<input type="submit" name="upload" value="Uploaden!" />
</form>


Beter gemaakt, zonder exit enzo.
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thx, wwj ervoor
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Jvdw schreef:
Thx, wwj ervoor
0,05 ik heb het script tenminste gevonden. Hij heeft er 1 ding bijgezet dat iedereen kan.
0
Marv

Lid

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Jellesch schreef:
Eerdere citaten tonen
Jvdw schreef:
Thx, wwj ervoor
0,05 ik heb het script tenminste gevonden. Hij heeft er 1 ding bijgezet dat iedereen kan.
iedereen kan googlen... dat je uperhaupt punten durft te vragen schater
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