ERLEDIGT
NEIN
NEIN
ANTWORTEN
23
23
ZUGRIFFE
1145
1145
EMPFEHLEN
-
Hi habe nen probl.
Habe mir nen kleinens Upload Formular gebastelt.
Das Uploaden funktzioniert auch wunderbar aber ich bekomme das entpacken
danach irgentwie nicht hin:
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
<? require('config.php');// ist der apsolute pfad drin $abpath if ($button=="upp") { // Wenn submit Button gedrückt. if($_FILES["datei"]["name"] == "") { echo "keine Datei"; } else { if($_FILES["datei"]["tmp_name"] == "") { echo "Fehler bei der Übertragung. (Eventuell Datei zu groß.. max. 2 MB)"; } else { // Datei verschieben.. if (move_uploaded_file($_FILES["datei"]["tmp_name"], "$abpath/$select/" . $_FILES["datei"]["name"])) { $file = "$abpath/$select/".$_FILES["datei"]["name"]; // ----------------------Hier DIE FEHLER ZEILE DIE DIE DATEI ENTPACKEN SOLL------------------------------- exec(unzip $file); echo "fertig"; }else { echo "doch ein fehler"; } } } } else { ?> <table width="100%" border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse"> <tr> <td colspan="2" height="25"><center>Datei Upload</center></td> </tr> <tr> <td width="100%" align="left"><br> <center> <form action="uploadtest.php" method="post" enctype="multipart/form-data"> <table> <tr> <? $dh = opendir($dir); while($file = readdir($dh)) { if ($file != "." && $file != ".." && is_dir($file)) {$dname[] = $file; sort($dname); reset ($dname); } } print "<hr align='left' width='400'><br>"; print "<b>Upload to:</b> <select name=\"select\">"; print "<option value=\"#\">Choose. . .</option><br>\n"; $u=0; foreach($dname as $key=>$val) { if($dname[$u]) { print "<option value=\"$dname[$u]\">$dname[$u]</option>\n"; $u++; } } print "</select>"; ?> <td>Datei auswählen: (max. 2 MB) <input name="datei" size="50" type="file"> <input type="submit" value="upp" name="button"></td> </tr> </table>
und hier der FEHLER: Parse error: parse error, unexpected T_VARIABLE in /opt/lampp/htdocs/test2/uploadtest.php on line 26
Kann mir da jemman mal helfen?
THXhttp://www.borgelite.de
http://www.zivi.de.am
-
Probier mal
PHP-Code:exec("unzip ".$file);
PHP Class Collection - PHP-Klassen fuer PHP 5 (und Teilweise auch fuer PHP 4)
Updates: Catcher 1.1, FTPConnection 1.2, MultiSQL 1.1, RSS2 1.1, SMTPConnection 1.4
__________________
EasyLFS - Hintergrundinformationen, Installationsanleitung, Softwareliste und Download
EasyLFS Projektthread - Informationen, Status und Diskussion zu meiner Linux-Distribution
__________________
__________________Ich bin die Schildkroete, mein Sohn. Ich habe das Universum erschaffen, aber bitte mach mir daraus keinen Vorwurf; ich hatte Bauchschmerzen.
Zitat von Friedrich Nietzsche
-
dann kommt das:
Parse error: parse error, unexpected $ in /opt/lampp/htdocs/35mm/upload1.php on line 72http://www.borgelite.de
http://www.zivi.de.am
-
Ich hab jetzt nicht wirklich die Motivation die Zeilen zu zaehlen.
Da der Fehler aber viel spaeter ist denke ich nicht, dass es ein neuer Fehler, sondern nur ein zusaetzlicher ist.
Zeig mal den Code um diese Zeile um gib an welche Zeile er genau meint.PHP Class Collection - PHP-Klassen fuer PHP 5 (und Teilweise auch fuer PHP 4)
Updates: Catcher 1.1, FTPConnection 1.2, MultiSQL 1.1, RSS2 1.1, SMTPConnection 1.4
__________________
EasyLFS - Hintergrundinformationen, Installationsanleitung, Softwareliste und Download
EasyLFS Projektthread - Informationen, Status und Diskussion zu meiner Linux-Distribution
__________________
__________________Ich bin die Schildkroete, mein Sohn. Ich habe das Universum erschaffen, aber bitte mach mir daraus keinen Vorwurf; ich hatte Bauchschmerzen.
Zitat von Friedrich Nietzsche
-
also nach meinen editor wäre das dir letzte zeile
aber das kann ja nicht sein denn er hat irgentwas mit dem zeichen $
oder sehe ich das falsch?http://www.borgelite.de
http://www.zivi.de.am
-
So richtig versteh ich den Fehler auch nicht, jedoch muss ich sagen, dass mir spontan dieser Abschnitt nicht gefaellt:
Mach daraus mal:PHP-Code:// Datei verschieben..
if (move_uploaded_file($_FILES["datei"]["tmp_name"], "$abpath/$select/" . $_FILES["datei"]["name"]))
{
$file = "$abpath/$select/".$_FILES["datei"]["name"];
PHP-Code:// Datei verschieben..
if (move_uploaded_file($_FILES["datei"]["tmp_name"], abpath."/".$select."/" . $_FILES["datei"]["name"]))
{
$file = $abpath."/".$select."/".$_FILES["datei"]["name"];
PHP Class Collection - PHP-Klassen fuer PHP 5 (und Teilweise auch fuer PHP 4)
Updates: Catcher 1.1, FTPConnection 1.2, MultiSQL 1.1, RSS2 1.1, SMTPConnection 1.4
__________________
EasyLFS - Hintergrundinformationen, Installationsanleitung, Softwareliste und Download
EasyLFS Projektthread - Informationen, Status und Diskussion zu meiner Linux-Distribution
__________________
__________________Ich bin die Schildkroete, mein Sohn. Ich habe das Universum erschaffen, aber bitte mach mir daraus keinen Vorwurf; ich hatte Bauchschmerzen.
Zitat von Friedrich Nietzsche
-
ich würde dir ja sagen das das funktionier.
Aber leider hat es das nicht es kommt immer noch genau der gleiche fehler.
Danke erstmal für deine mühe!http://www.borgelite.de
http://www.zivi.de.am
-
Entweder bin ich schon zu betrunken um den Fehler zu sehen oder irgendwas ist die irgendwie komisch.
Poste bitte nochmal die ganze Datei, und nochmal den genauen Wortlaut der Fehlermeldung.PHP Class Collection - PHP-Klassen fuer PHP 5 (und Teilweise auch fuer PHP 4)
Updates: Catcher 1.1, FTPConnection 1.2, MultiSQL 1.1, RSS2 1.1, SMTPConnection 1.4
__________________
EasyLFS - Hintergrundinformationen, Installationsanleitung, Softwareliste und Download
EasyLFS Projektthread - Informationen, Status und Diskussion zu meiner Linux-Distribution
__________________
__________________Ich bin die Schildkroete, mein Sohn. Ich habe das Universum erschaffen, aber bitte mach mir daraus keinen Vorwurf; ich hatte Bauchschmerzen.
Zitat von Friedrich Nietzsche
-
ok bitte
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
<? require('config.php');// ist der apsolute pfad drin $abpath if ($button=="upp") { // Wenn submit Button gedrückt. if($_FILES["datei"]["name"] == "") { echo "keine Datei"; } else { if($_FILES["datei"]["tmp_name"] == "") { echo "Fehler bei der Übertragung. (Eventuell Datei zu groß.. max. 2 MB)"; } else { // Datei verschieben.. if (move_uploaded_file($_FILES["datei"]["tmp_name"], abpath."/".$select."/" . $_FILES["datei"]["name"])) { $file = $abpath."/".$select."/".$_FILES["datei"]["name"]; // ----------------------Hier DIE FEHLER ZEILE DIE DIE DATEI ENTPACKEN SOLL------------------------------- exec("unzip ".$file); echo "fertig"; }else { echo "doch ein fehler"; } } } } else { ?> <table width="100%" border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse"> <tr> <td colspan="2" height="25"><center>Datei Upload</center></td> </tr> <tr> <td width="100%" align="left"><br> <center> <form action="uploadtest.php" method="post" enctype="multipart/form-data"> <table> <tr> <? $dh = opendir($dir); while($file = readdir($dh)) { if ($file != "." && $file != ".." && is_dir($file)) {$dname[] = $file; sort($dname); reset ($dname); } } print "<hr align='left' width='400'><br>"; print "<b>Upload to:</b> <select name=\"select\">"; print "<option value=\"#\">Choose. . .</option><br>\n"; $u=0; foreach($dname as $key=>$val) { if($dname[$u]) { print "<option value=\"$dname[$u]\">$dname[$u]</option>\n"; $u++; } } print "</select>"; ?> <td>Datei auswählen: (max. 2 MB) <input name="datei" size="50" type="file"> <input type="submit" value="upp" name="button"></td> </tr> </table>
und der fehler:
Code :1
Parse error: parse error, unexpected $ in /opt/lampp/htdocs/35mm/upload1.php on line 72
http://www.borgelite.de
http://www.zivi.de.am
-
Ich war mal so frei Deinen Code meinem Stil anzupassen um ihn schneller lesen zu koennen. Dabei ist mir aufgefallen, dass Du wohl das else nicht schliesst.
Mein Vorschlag:
PHP-Code:<?
require('config.php');
if ($button=="upp")
{
if($_FILES["datei"]["name"] == "")
{
echo "keine Datei";
}
else
{
if($_FILES["datei"]["tmp_name"] == "")
{
echo "Fehler bei der Übertragung. (Eventuell Datei zu groß.. max. 2 MB)";
}
else
{
if (move_uploaded_file($_FILES["datei"]["tmp_name"],$abpath."/".$select."/".$_FILES["datei"]["name"]))
{
$file = $abpath."/".$select."/".$_FILES["datei"]["name"];
exec("unzip ".$file);
echo "fertig";
}
else
{
echo "doch ein fehler";
}
}
}
}
else
{
?>
<table width="100%" border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse">
<tr>
<td colspan="2" height="25"><center>Datei Upload</center></td>
</tr>
<tr>
<td width="100%" align="left"><br>
<center>
<form action="uploadtest.php" method="post" enctype="multipart/form-data">
<table>
<tr>
<?
$dh = opendir($dir);
while($file = readdir($dh))
{
if ($file != "." && $file != ".." && is_dir($file))
{
$dname[] = $file;
sort($dname);
reset ($dname);
}
}
print "<hr align='left' width='400'><br>";
print "<b>Upload to:</b> <select name=\"select\">";
print "<option value=\"#\">Choose. . .</option><br>\n";
$u=0;
foreach($dname as $key=>$val)
{
if($dname[$u])
{
print "<option value=\"$dname[$u]\">$dname[$u]</option>\n";
$u++;
}
}
print "</select>";
?>
<td>Datei auswählen: (max. 2 MB) <input name="datei" size="50" type="file">
<input type="submit" value="upp" name="button"></td>
</tr>
</table>
<?
}
?>PHP Class Collection - PHP-Klassen fuer PHP 5 (und Teilweise auch fuer PHP 4)
Updates: Catcher 1.1, FTPConnection 1.2, MultiSQL 1.1, RSS2 1.1, SMTPConnection 1.4
__________________
EasyLFS - Hintergrundinformationen, Installationsanleitung, Softwareliste und Download
EasyLFS Projektthread - Informationen, Status und Diskussion zu meiner Linux-Distribution
__________________
__________________Ich bin die Schildkroete, mein Sohn. Ich habe das Universum erschaffen, aber bitte mach mir daraus keinen Vorwurf; ich hatte Bauchschmerzen.
Zitat von Friedrich Nietzsche
-
a super danke aber deswegen entpackt er die datei trotzdem nicht.
http://www.borgelite.de
http://www.zivi.de.am
-
Die Fehlermeldung sind wir jetzt aber los?
PHP Class Collection - PHP-Klassen fuer PHP 5 (und Teilweise auch fuer PHP 4)
Updates: Catcher 1.1, FTPConnection 1.2, MultiSQL 1.1, RSS2 1.1, SMTPConnection 1.4
__________________
EasyLFS - Hintergrundinformationen, Installationsanleitung, Softwareliste und Download
EasyLFS Projektthread - Informationen, Status und Diskussion zu meiner Linux-Distribution
__________________
__________________Ich bin die Schildkroete, mein Sohn. Ich habe das Universum erschaffen, aber bitte mach mir daraus keinen Vorwurf; ich hatte Bauchschmerzen.
Zitat von Friedrich Nietzsche
-
ja super

jetzt habe ich den pfad direkt eingetragen :
aber dann kommt trotzdem nen fehlerCode :1
exec(unzip /opt/lampp/htdocs/35mm/imagefolder1/bilder.zip);

Parse error: parse error, unexpected T_STRING in /opt/lampp/htdocs/35mm/upload1.php on line 20http://www.borgelite.de
http://www.zivi.de.am
-
Du musst den Parameter von exec in "" setzen, da es keine Variable ist.
PHP Class Collection - PHP-Klassen fuer PHP 5 (und Teilweise auch fuer PHP 4)
Updates: Catcher 1.1, FTPConnection 1.2, MultiSQL 1.1, RSS2 1.1, SMTPConnection 1.4
__________________
EasyLFS - Hintergrundinformationen, Installationsanleitung, Softwareliste und Download
EasyLFS Projektthread - Informationen, Status und Diskussion zu meiner Linux-Distribution
__________________
__________________Ich bin die Schildkroete, mein Sohn. Ich habe das Universum erschaffen, aber bitte mach mir daraus keinen Vorwurf; ich hatte Bauchschmerzen.
Zitat von Friedrich Nietzsche
-
ja thx jetzt kommt zwar kein fehler aber entpachen tut er sie auch nicht.
a mom wenn ichs so mache
entpackt er sie da wo das upload1.php script aufgerufen wird und nicht in das obige verzeichniss.Code :1
exec("unzip /opt/lampp/htdocs/35mm/imagefolder1/bilder.zip");Geändert von borgelite (04.04.05 um 19:22 Uhr)
http://www.borgelite.de
http://www.zivi.de.am
Ähnliche Themen
-
.gz entpacken
Von Raven280438 im Forum PHPAntworten: 5Letzter Beitrag: 25.10.08, 14:04 -
Jar entpacken
Von Leroux im Forum Microsoft WindowsAntworten: 2Letzter Beitrag: 08.10.08, 11:32 -
zip upload, entpacken und in datenbank eintragen
Von napsio im Forum PHPAntworten: 10Letzter Beitrag: 15.11.04, 19:58 -
*.gz entpacken
Von ChuloGT im Forum PHPAntworten: 2Letzter Beitrag: 02.11.04, 13:53 -
Entpacken von .zip
Von rauchmelder im Forum PHPAntworten: 1Letzter Beitrag: 05.09.04, 19:31





Zitieren
Login






[PHP] [Codeschnipsel] ImageColor aus HTML-Farbcodierung erstellen