0

I want to send multiple variables in a query string like this:

<a href="deleteProduct.php?id=11?Mid='A'"></a>

and then I want to get these on next page like this :

$del=$_GET['id'];
$menu=$_GET['Mid'];

But it gives me error that Mid is undefined. I will be grateful if , some help me . Thanks in advance

2
  • you can test with isset($_GET['Mid']) before consuming $_GET['Mid']... isset() Commented Dec 12, 2015 at 6:27
  • You're query string should look like ?Mid=foo&id&other=true. Then $_GET['Mid'] will be 'foo', $_GET['id'] will be null and $_GET['other'] will be 'true'; Commented Dec 12, 2015 at 6:30

1 Answer 1

1

Just put an & between the name-value pairs in your link. Nothing else required.

? is there only for the first pair, after that all of them come after &, for example

delete.php?id=1
delete.php?id=1&id2=3
delete.php?id=1&id2=3&this=test
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.