This probably a simple answer but I can't seems to understand the logic here.
I have multiple form in the same page and I use this structure on most of them:
<form name="" action="../charmodif/charinfo.php?charname=<?php echo $name ?>" method="post">
<input onblur="this.form.submit();" type="text" name="actualxp" value="<?php echo $infochar['actualxp']; ?>">
<form>
The main part of my php processing file: $charname = $_GET['charname'];
foreach (array_keys($_POST) as $field)
{
mysqli_query($conn,"
UPDATE `character`
SET `" . $field . "`='" . $_POST[$field] . "'
WHERE name='" . $charname . "';
");
}
The problem I have is that it actually seems to submit all form in the page at the same time. It result in my php function to process the MySQL for every form at the same time.
I verified this using simple echo with the POST in the php action.
It seems to me that the bigger is the page, the longer it's going to take to process the data. It's mainly for performance than anything else since it's actually working very well anyway.
How can I have this simple form submit it for itself only? Any idea?
Thanks,
Change the last line:
<form name="" action="../charmodif/charinfo.php?charname=<?php echo $name ?>" method="post">
<input onblur="this.form.submit();" type="text" name="actualxp" value="<?php echo $infochar['actualxp']; ?>">
</form>