0

I want to bring many $_REQUEST from Tag but only $_REQUEDT['editid'] works. how to solve it.

 echo "<td><a href=product.php?editid=$id, editname=$name, editqty=$qty, editprice=$price>Edit</a></td>";

//when I put $_REQUEST['editid'] in input it works but others not.

<form action="product.php">
    <table> 
            <tr>
                <td>ID</td>
                <td><input type="text" name="tid" value="<?php if(isset($_REQUEST['editid'])){echo $_REQUEST['editid'];} ?>"></td>
            </tr>
            <tr>
                <td>Name</td>
                <td><input type="text" name="tname" value="<?php if(isset($_REQUEST['editname'])){echo $_REQUEST['editname'];}?>"></td>
            </tr>
            <tr>
                <td>Qty</td>
                <td><input type="text" name="tqty" ></td>
            </tr>
            <tr>
                <td>Price</td>
                <td><input type="text" name="tprice" ></td>
            </tr>
            
            <tr>
                <td></td>
                <td><button type="submit" name="btn-add">Add</button>
                <button type="submit" name="btn-clear">Clear</button></td>
                
            </tr>
        </table>
    </form>
1
  • Please elaborate on “it works but others not”, specifically “works” Commented Nov 9, 2022 at 3:08

1 Answer 1

2

The URL parameters after the 1st one should be separated by & (not ,)

Change from

<a href=product.php?editid=$id, editname=$name, editqty=$qty, editprice=$price>

to

<a href="product.php?editid=$id&editname=$name&editqty=$qty&editprice=$price">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.