Mehr als ein Formular auf einer Seite

Mein Bild-Upload-Formular auf meiner Profilbearbeitungsseite funktioniert nicht. Die beiden Formulare müssen getrennt sein, da sie unabhängig voneinander funktionieren. Das Bild-Upload-Skript lädt das Bild hoch, bevor das Profilbearbeitungsformular gesendet wird.

Ich habe den Bild-Upload auf einer separaten Seite getestet, auf der es das einzige auf der Seite war, und es hat funktioniert. Ich gehe also davon aus, dass es die andere Form ist, die es vermasselt. Die beiden Formulare arbeiten mit unterschiedlichen Skripten und beide Methoden sind Posts.

Hier ist das jscript

<script type="text/javascript" src="imageupload/scripts/jquery.min.js"></script>
<script type="text/javascript" src="imageupload/scripts/jquery.form.js"></script>
<script type="text/javascript" >
  $(document).ready(function() { 
    $('#photoimg').live('change', function() { 
        $("#preview").html('');
        $("#preview").html('<img src="imageupload/loader.gif" alt="Uploading...."//>');
        $("#cropimage").ajaxForm({ target: '#preview' }).submit();
    });
  }); 
</script>

Hier ist die Form;

<form id="cropimage" method="post" enctype="multipart/form-data" action="../imageupload/ajaximage.php">
  <input type="file" name="photoimg" id="photoimg" class="filebutton"/><br>
</form>

Hier ist die andere Form. Es ist eine lange;

    echo '<form action="phpscripts/artistupdate.php" method="post" id="profileedit"><input type="text" name="artistname" value="'. $row['artistname'].'" class="name"     maxlength="80"><span id="editlink"><t1>Your profile link will be: <br><a     href="http://newbornsounds.co.uk/artists/artist.php?artist='.$row['artistname'].'">    <b>http://newbornsounds.co.uk/artists/artist.php?artist=<FONT style="BACKGROUND-COLOR: yellow">'.$row['artistname'].'</font></b></a></span><br><div id="urlwarn"><t1>Please note that if you change your url all the links you have placed outside of NBS will be affected.</t1></div>';
  }
}
?>
<hr>
<?php 
  $username = $_SESSION['username'];
  $pass = $_SESSION['password']; 
  include ("../database.php");
  $result = mysql_query("SELECT * FROM members WHERE username='$username' AND     password='$pass' AND artist='Y'");

  while($row = mysql_fetch_array($result)){
    echo '<div id="artistsbio"><textarea name="bio" rows="10" cols="80" name="bio" value="'.     $row['bio']. '" class="bio">'. $row['bio']. '</textarea><br><div id="probwarn"><t1>Everything is still in the beta stage so there are bound to be a few problems. If you spot one please <a     href="mailto:[email protected]"><b>tell us about it.</b></a></t1></div>';
  }
?>
<br><br>
<input type="submit" name="submit" value="Done" class="button"></form>

Antworten auf die Frage(1)

Ihre Antwort auf die Frage