Svona…
<b>
<?
$thePass = ‘passinnþinn’;
?>
<form action=“” method=“post” enctype=“multipart/form-data”>
Lykilorð:<br>
<input type=“text” name=“pass”>
Skrá:<br>
<input type=“file” name=“skra”>
<br><br>
<input type=“submit” name=“x” value=“Uploada”>
<input type=“hidden” name=“submit” value=“1”>
</form>
<?
if( isset( $_POST['submit'] ) )
{
if( $_FILES['skra']['tmp_name'] && $_POST['pass'] )
{
if( $_POST['pass'] != $thePass )
echo ‘Rangt lykilorð.’;
else
{
if( move_uploaded_file( $_FILES['skra']['tmp_name'], $_FILES['skra']['name'] ) )
echo ‘Tókst að uploada skrá.’;
else
echo ‘Tókst ekki að uploada skrá.’;
}
}
else
echo ‘Þú verður að velja einhverja skrá sem þú vilt uploada.’;
}
?>
</
Gaui