• 15.02.2026, 04:00
  • Register
  • Login
  • You are not logged in.

 

Dear visitor, welcome to Aqua Computer Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Eumel

God

PHP Problem

Friday, April 9th 2004, 12:01pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
  if($was=="doit")
  {
    $size = $bild_size; // Größe der Datei 
    $name = $bild_name; // Der Originalname 
    $type = $bild_type; // Der MIME Type der Datei 
      
    if(eregi("(txt&#124;map)$",$name))
      {
        if(file_exists("../../files/&name"))
        {
          echo "File already exists!.";
        }
        else if($size<2000000 AND $size!=0)
        { 
          copy($bild,"../../files/$name"); // Kopiert das Bild
        
            echo "Your file was uploaded successfully!<br>"; 
        echo "Size: ".$size." Byte<br>"; 
        echo "Name: ".$name."<br>";
        
      echo "MIME-Type: ".$type."<br>";
      echo "Ansehen: <a href=../../files/$name>".$name."</a>";  
      }
        else
        { 
        echo "Your file is bigger than 2.000.000 bytes or equal 0 bytes or already there.";  
      } 
    }
      else
      { 
      echo "Invalid file: ".$name; 
    } 

  }
  else
  { 
    echo "<form action='".$PHP_SELF."' enctype=\"multipart/form-data\" method='post'>"; 
    echo "<input type='hidden' name='was' value='doit'>"; 
    echo "<table>"; 
    echo "<tr>"; 
      echo "<td>File: </td>"; 
      echo "<td><input type='file' name='bild'></td>"; 
    echo "</tr><tr>"; 
      echo "<td> </td>"; 
      echo "<td><input type='submit' value='Upload'></td>"; 
    echo "</tr>"; 
    echo "</form></table>"; 
  } 
?>


Warum zum Geier überschreibt der immernoch Dateien beim Hochladen? Das ist doch eine file_exists-if-anweisung ?!

Ich seh da nich mehr durch ^^

MfG
"I've always said, the Web is the sum of all human knowledge plus porn.", Ron Gilbert
UltraStar Manager 1.7.2 | Infos zu meinem PC | .o0 DeathSpank 0o.

PAB

God

Re: PHP Problem

Friday, April 9th 2004, 12:11pm

Quoted

if(file_exists("../../files/&name"))

Kleiner Tippfehler

sliP

Junior Member

Re: PHP Problem

Friday, April 9th 2004, 12:24pm

leiten wir variablen neuerdings mit & ein ?! :D Mach nen $ davor dann klappts auch ^^
$i = 1; for ($i =1; $i =2; $i++) { echo "wait; for $life"; break; } ... ... ... --------------------------------------------- Suche noch jemanden der alte AC Teile für wenig Geld auf Lager hat und loswerden will. Einfach mal an mich schreiben. Vielen Dank im Voraus

Eumel

God

Re: PHP Problem

Friday, April 9th 2004, 5:41pm

Danke! :D

Hab ich ne Möglichkeit, aus dem "Durchsuchen..." ein "Browse..." zu machen?

http://www.sod-bf1942.de/ftf/content/upload/upload.php

MfG
"I've always said, the Web is the sum of all human knowledge plus porn.", Ron Gilbert
UltraStar Manager 1.7.2 | Infos zu meinem PC | .o0 DeathSpank 0o.

Y0Gi

God

Re: PHP Problem

Friday, April 9th 2004, 7:18pm

nein, das ist OS-abhängig.

tipps:
im php-teil bringt maskieren von umlauten gar nix
umlaute kannste normal schreiben, wenn du im header die richtige code-page setzt (iso-55-irgendwas, vgl. selfhtml/w3cvalidator).
in php strings in einfache hochkommata statt doublequotes setzen, das spart insgesamt parsezeit, weil nicht nach variablen gescannt wird.

Eumel

God

Re: PHP Problem

Saturday, April 10th 2004, 10:45am

Na, wenn die englischen Nutzer da "browse" stehen haben, reicht mir das eigentlich. ;)

MfG
"I've always said, the Web is the sum of all human knowledge plus porn.", Ron Gilbert
UltraStar Manager 1.7.2 | Infos zu meinem PC | .o0 DeathSpank 0o.

Y0Gi

God

Re: PHP Problem

Saturday, April 10th 2004, 2:14pm

bei mir in opera steht da "choose", in firefox "browse..." - geht in ordnung? :)

Eumel

God

Re: PHP Problem

Saturday, April 10th 2004, 5:35pm

*hehe* OK.

MfG
"I've always said, the Web is the sum of all human knowledge plus porn.", Ron Gilbert
UltraStar Manager 1.7.2 | Infos zu meinem PC | .o0 DeathSpank 0o.