For general understanding
When you include certain key-value pairs in your request url, PHP will load these values (accordingly) into the $_GET
superglobal.
?x=12&y=13
Will result in
$_GET['x'] // contains 12
$_GET['y'] // contains 13
What you seem to be trying to do is to supply multiple key-value pairs within a key-value pair:
?stuff={more-key-value-pairs}
Simply be aware that PHP will not interpret key-value pairs in $_GET['stuff']
.
Encoding/Decoding
Note: This is one possible solution out of many. Find the one that suits you most and apply it.
You can use base64_encode() to encode it, and base64_decode() to decode it.
Example:
echo '<img src="returnpicture.php?stuff=' . rawurlencode( base64_encode('x=27&y=3&z=123456') ) . '" />';
Usage of rawurlencode()
assures proper url safe encoding of the base64-encoded string.
In your returnpicture.php you can use:
$decodedString = base64_decode( $_GET['stuff'] );
to get back your original string.
However, if you actually plan on sending a get-request like string (with variable assignments, such as ?x=12&y=13
and so on, then you need to apply further techniques to get that string parsed.