-2

I have a link in which I want to pass multiple values but, not sure how. If I just pass $id then the query string works but not with $title.

My code:

<td><a href="VotingPoll.php?id='.$id.'?title='.$title.'"><button class="btn btn-primary btn-small">VIEW</button></a></td>
3

1 Answer 1

0

You could just send multiple query params with the same name:

<td><a href="VotingPoll.php?id='.$id.'&id='.$id2.'&title='.$title.'"><button class="btn btn-primary btn-small">VIEW</button></a></td>
Sign up to request clarification or add additional context in comments.

3 Comments

Only the last id will be available you would need to use an array id[] for multiple.
You might have a problem with your web server, I tested with a Jersey rest endpoint, and receiving as a '@QueryParam' with List<String> type it receives the multiple values ok @AbraCadaver
This is PHP which will give you only 1 id.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.