2 variables in an URL

S

stephane

I thought it was possible to send two variables in an URL
like this:

print" <script type='text/javascript'>
document.location.replace('http://127.0.0.1/add_task.php?tk_request_name={$req_name}?tk_req_id={$maxValue}');
</script>";

but I can't get them separately in add_task.php

is there something wrong with script?

I use this code in some other PHP code.
 
D

David Dorward

There should only be one "?". The second one should be replaced with "+".

Query string key/value pairs should be separated with ampersand characters
(or semi-colons). A plus is an encoded space, and is quite acceptable as
part of the value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top