Nieuw lid |
|
upload.phprn[code]form action=insert.php method=post rnp rnSelecteer een bestand   input name=link type=filebr rnrnbrrninput type=submit value=Upload bestandrnp rnform rnbody rnhtml rnrn rnglobal $_FILES; rnrn$filename = $_FILES['link']['name']; rnrn$allow[0] = doc; rn$allow[1] = txt; rn$allow[2] = pdf; rn$allow[3] = xls;rn$allow[3] = rtf;rnrn$uploadname = $_FILES['link']['name']; rn rn$extentie = substr($uploadname, -3); rnrnfor ($i = 0; $i count($allow); $i++) rn{ rn if ($extentie == $allow[$i]) rn { rn $extentie_check = ok; rn $i = count($allow) + 5; om loop te beindigen rn } rn} rnrnif ($extentie_check) rn{ rn if (is_uploaded_file($_FILES['link']['tmp_name'])) { rn move_uploaded_file($_FILES['link']['tmp_name'], uploads . $uploadname); rn rn echo (script language=javascript window.location=insert.php; script); rn } rn} rnelse rn{ rnrn} rn[code]rnrninsert.phprn[code]form method=post action=insert2.phprnBeschrijving     input type=Text name=beschrijving size=50brrnNaam bestand input type=text name=link size =50 value==$_POST['link']; i(incl. extensie)ibrbrrninput type=submit value=Insert name=submitrnphp echo $_POST['naam_file_form'];rnform[code]rnrninsert2.phprnrn[code]phprninclude (connectdb);rnrnif (empty($_POST)){rn echo(Vul eerst de gegevens over de linka in);rn exit();rn}else{rn OK, Query opbouwen met variabelen in $_POSTrn $query=INSERT INTO document (link, beschrijving) ;rn $query .= VALUES ('; let op positie van de enkele aanhalingstekens rn $query .= httplocalhostuploads.$_POST[link] .', ' ;rn $query .= $_POST[beschrijving] .'); ;rn $result = mysql_query($query) or die (FOUT . mysql_error());rn}rnrnhtmlrnheadrn titleInsert 2titlernheadrnbody bgcolor=#F5F5DCrnphprn echo(De volgende gegevens zijn ingevoegdbrbr);rn echo(bBeschrijvingb . $_POST[beschrijving] . br);rn echo(bLinkb . $_POST[link] . brbrbr);rn rn Klik a href=index.phphiera om naar de indexpagina te gaanrnbodyrnhtml[code]rnrnIn welke pagina moet de code |