quicksilver
Lt. Junior Grade
- Registriert
- Jan. 2004
- Beiträge
- 363
Hallo ich bin auf der suche nach einer möglichkeit z.b. per javascript. Dynamisch die Anzahl von Formularen zu ändern. Ich möchte halt das da z.b. ein textfeld ist wo ich die anzahl eingebe und das die seite dann kurz aktualisiert wird und die neue anzahl der formulare geändert wird.
Das ist das was ich im moment habe:
In der Variable $_GET["forms"] wird die Anzahl der Formulare festgelegt. Da suche ich nun ein weg es variable anzupassen. Kann mir da wer helfen?
Das ist das was ich im moment habe:
PHP:
<?php
if(checkRights($myid, gallerie_pic_up)) {
$headline = "Bilder hochladen";
$content = "";
$forms = $_GET["forms"];
if ($forms == "") { $forms = "10"; }
if ($_POST['action'] == "send")
{
$fehlernr = "0";
// start for loop
//$dir = "../".$picpath."tmp/";
$dir = $picpath."tmp/";
for($x=0;$x<$forms;$x++)
{
if ($_FILES['uploadFile'. $x]['name'])
{
if(ereg(".jpg$",$_FILES['uploadFile'. $x]['name']) || ereg(".jpeg$",$_FILES['uploadFile'. $x]['name']))
{
$_FILES['uploadFile'. $x]['name'] = strtolower($_FILES['uploadFile'. $x]['name']);
$file_name = $_FILES['uploadFile'. $x]['name'];
// strip file_name of slashes
$file_name = stripslashes($file_name);
$file_name = str_replace("'","",$file_name);
$copy = copy($_FILES['uploadFile'. $x]['tmp_name'],$dir.$file_name);
// check if successfully copied
if($copy)
{
$content .= "$file_name | Datei Erfolgreich Hochgeladen!<br />";
}
else
{
$content .= "$file_name | Datei konnte nicht hochgeladen werden!";
}
}
else
{
$content .=$_FILES['uploadFile'. $x]['name']." ist kein Jpg/Jpeg File<br />";
}
}
else
{
$fehlernr++;
}
}
}
if ($fehlernr == "10") { $content .="Bitte wählen sie eine Datei zum hochladen aus";
$content .= "<meta http-equiv=\"refresh\" content=\"4; URL=?open=gallerie&view=upload\">";
// end of loop
}
// upload formulare erstellen
$content .="<form name=\"form\" enctype=\"multipart/form-data\" method=\"post\" action=\"?open=gallerie&view=upload\"><input type=\"hidden\" name=\"action\" value=\"send\">";
for($x=0;$x<$forms;$x++)
{
$content .="<input class=\"input\" name=\"uploadFile".$x."\" type=\"file\" id=\"uploadFile".$x."\"><br />";
}
$content .="<input type=\"submit\" name=\"Submit\" value=\"Submit\"></form>";
$content .= $status;
}
?>
In der Variable $_GET["forms"] wird die Anzahl der Formulare festgelegt. Da suche ich nun ein weg es variable anzupassen. Kann mir da wer helfen?