Kevin Brown
Kevin Brown

Reputation: 13

Need help passing two php variables through a url to the next page

I'm new to Php but what I need this php code to do is to pass two variables through the URL like this

<td align="center"><a class="btn btn-danger" href="reserve.php?distroid=<?php echo $row["distroid"] echo $row['orderid']; ?>">Place Order</a></td>

When we try and do it with just distroid, it works completely fine. But I'm unsure how to pass both values.

Any help would be appreciated.

EDIT: SOLVED IT THANK YOU FOR THE HELP ALL

Upvotes: 1

Views: 57

Answers (3)

Kaushik Kothiya
Kaushik Kothiya

Reputation: 59

Try this query string like this :

<td align="center">
    <a class="btn btn-danger" 
        href="reserve.php?distroid=<?php echo $row["distroid"]."&orderid=".$row['orderid']; ?>">
        Place Order
    </a>
</td>

Then you can get both variable distroid and orderid

Upvotes: 2

sagar
sagar

Reputation: 94

Hi you can try this anchor tag, it will work for you:

 <a class="btn btn-danger" href="reserve.php?distroid=<?php echo $row['distroid']; 
 ?>&orderid=<?php echo $row['orderid']; ?>">
    Place Order
  </a>

Upvotes: 0

Adrian Edy Pratama
Adrian Edy Pratama

Reputation: 4001

Try to add more key for the query string like this :

<td align="center">
    <a class="btn btn-danger" 
        href="reserve.php?distroid=<?php echo $row["distroid"]; ?>&orderid=<?php echo $row['orderid']; ?>">
        Place Order
    </a>
</td>

Then you can get both distroid and orderid

Upvotes: 2

Related Questions