Answer the question
In order to leave comments, you need to log in
how to pass parameter via ajax in php?
There is such a problem:
<form method="post" action="index.php?action=add&code=<?php echo $row["code"]; ?>">
<input type="text" name="price">
<input type="text" name="name">
</form>
Answer the question
In order to leave comments, you need to log in
Alternatively, you can simply add 1 hidden input and set the value to $row['code'].
In general, I don’t quite understand why send the form using the standard method if you use ajax.
Hmm, here is POST, here is GET, and AJAX...
<form method=post action="index.php">
<input type=hidden name=action value='add'>
<input type=hidden name=code value='<?php echo $row["code"]; ?>'>
<input type=text name="price">
<input type=text name="name">
</form>
if ($_GET['action'] == "add")
if ($_POST['action'] == "add")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question