Avatar billede thomasfricke Juniormester
21. maj 2009 - 12:58 Der er 5 kommentarer og
1 løsning

Upload af 3 billeder +Resize.

Hej Eksperter...

Har fundet en lille guide, på at uploade filer via php.
Guiden har følgene link: http://www.tizag.com/phpT/fileupload.php

Meeeen, jeg er måske lidt krævende. Fordi at for det 1. skal der uploades 3 billeder, på en gang og samtidis skal hvert biller resizes 2 gange.
(Dvs. 1x original billed + 1x en str. + 1x anden str.)
Avatar billede thomasfricke Juniormester
21. maj 2009 - 14:20 #1
;) Nyd Helligdagen...

1time og 20min, og intet svar er kommet...

Hehe, i nyder helligdagen... Super!
Avatar billede thomasfricke Juniormester
21. maj 2009 - 15:00 #2
<form enctype="multipart/form-data" action="?site=billed/maveconnect.php" method="post">
<table height="20" width="400">
   
    <tr height="20" width="400">
        <td height="20" width="140" colspan="2">
            <font class="font2">Uge:</font>
        </td>
        <td height="20" width="260">
            <input type="text" name="uge" size="19">
        </td>
    </tr>
   
    <tr height="20" width="400">
        <td height="20" width="140" colspan="2">
            <font class="font2">1 Billed:</font>
        </td>
        <td height="20" width="260">
            <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>
            <input name="uploadedfile1" type="file" />
        </td>
    </tr>
   
    <tr height="20" width="400">
        <td height="20" width="140" colspan="2">
            <font class="font2">2 Billed:</font>
        </td>
        <td height="20" width="260">
            <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>
            <input name="uploadedfile2" type="file" />
        </td>
    </tr>
   
    <tr height="20" width="400">
        <td height="20" width="140" colspan="2">
            <font class="font2">3 Billed:</font>
        </td>
        <td height="20" width="260">
            <input type="hidden" name="MAX_FILE_SIZE" value="10000000"/>
            <input name="uploadedfile3" type="file" />
        </td>
    </tr>
   
</table>

    <input type="submit">
</form>
Avatar billede thomasfricke Juniormester
21. maj 2009 - 15:01 #3
<?
$username="xxx";
$password="xxx";
$database="xxx";

$uge=$_POST['uge'];

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "INSERT INTO mave VALUES ('','$uge')";
mysql_query($query);

mysql_close();

echo "<br><font>Udført - </font><a href='?site=billed/maveadd.php'><font>Tilbage</font>";
?>

<?
// Where the file is going to be placed
$target_path = "billed/mave/";
// Fil 1
$target_path = $target_path . basename( $_FILES['uploadedfile1']['name']);

if(move_uploaded_file($_FILES['uploadedfile1']['tmp_name'], $target_path)) {
    echo "<br>The 1. file ".  basename( $_FILES['uploadedfile1']['name']).
    " has been uploaded";
} else{
    echo "<br>There was an error uploading the file, please try again!";
}
?>

<?
// Where the file is going to be placed
$target_path = "billed/mave/";
// Fil 2
$target_path = $target_path . basename( $_FILES['uploadedfile2']['name']);

if(move_uploaded_file($_FILES['uploadedfile2']['tmp_name'], $target_path)) {
    echo "<br>The 2. file ".  basename( $_FILES['uploadedfile2']['name']).
    " has been uploaded";
} else{
    echo "<br>There was an error uploading the file, please try again!";
}
?>

<?
// Where the file is going to be placed
$target_path = "billed/mave/";
// Fil 3
$target_path = $target_path . basename( $_FILES['uploadedfile3']['name']);

if(move_uploaded_file($_FILES['uploadedfile3']['tmp_name'], $target_path)) {
    echo "<br>The 3. file ".  basename( $_FILES['uploadedfile3']['name']).
    " has been uploaded";
} else{
    echo "<br>There was an error uploading the file, please try again!";
}
?>
Avatar billede dk-andersson Nybegynder
22. maj 2009 - 07:45 #4
Er der noget Guld i opgaven?
Avatar billede thomasfricke Juniormester
22. maj 2009 - 22:37 #5
Om der er guld i opgaven. ???
Avatar billede thomasfricke Juniormester
30. maj 2009 - 21:09 #6
LUKKER!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester