Dit is het script:
<?php
$path = "";
$max_size = 2000000;
if (!isset($HTTP_POST_FILES['userfile'])) exit;
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
if ($HTTP_POST_FILES['userfile']['size']>$max_size) { echo "Het bestand is te groot :(<br>\n"; exit; }
if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg")) {
if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "De bestandsnaam is reeks in gebruik, verander deze.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .
$HTTP_POST_FILES['userfile']['name']);
if (!$res) { echo "upload niet gelukt, probeer het nog eens<br>\n"; exit; } else { echo "upload sucessvol :)<br>\n"; }
echo "Bestandsnaam: ".$HTTP_POST_FILES['userfile']['name']."<br>\n";
echo "Bestandsgrootte: ".$HTTP_POST_FILES['userfile']['size']." bytes<br>\n";
echo "Bestandstype: ".$HTTP_POST_FILES['userfile']['type']."<br>\n";
} else { echo "Dit type bestand is niet toegestaan!<br>\n"; exit; }
}
?>
Wellicht een makkelijke vraag, nu moeten de images (jpg/gif) in de html pagina 'images.htm' komen, maar ik weet niet waar ik dit kan veranderen. Ga binnenkort toch maar eens php/html leren maar ik heb dit script dringend nodig daarom de vraag. Wellicht een makkelijke voor jullie
Ik heb zelf het idee dat het bij path moet of zo, maar kan iemand dit even intypen die regel die moet worden gewijzigd? Zou erg handig zijn.
Alvast bedankt
<?php
$path = "";
$max_size = 2000000;
if (!isset($HTTP_POST_FILES['userfile'])) exit;
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
if ($HTTP_POST_FILES['userfile']['size']>$max_size) { echo "Het bestand is te groot :(<br>\n"; exit; }
if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg")) {
if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "De bestandsnaam is reeks in gebruik, verander deze.<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .
$HTTP_POST_FILES['userfile']['name']);
if (!$res) { echo "upload niet gelukt, probeer het nog eens<br>\n"; exit; } else { echo "upload sucessvol :)<br>\n"; }
echo "Bestandsnaam: ".$HTTP_POST_FILES['userfile']['name']."<br>\n";
echo "Bestandsgrootte: ".$HTTP_POST_FILES['userfile']['size']." bytes<br>\n";
echo "Bestandstype: ".$HTTP_POST_FILES['userfile']['type']."<br>\n";
} else { echo "Dit type bestand is niet toegestaan!<br>\n"; exit; }
}
?>
Wellicht een makkelijke vraag, nu moeten de images (jpg/gif) in de html pagina 'images.htm' komen, maar ik weet niet waar ik dit kan veranderen. Ga binnenkort toch maar eens php/html leren maar ik heb dit script dringend nodig daarom de vraag. Wellicht een makkelijke voor jullie
Ik heb zelf het idee dat het bij path moet of zo, maar kan iemand dit even intypen die regel die moet worden gewijzigd? Zou erg handig zijn.
Alvast bedankt