Creating conversations via URL

I think an ampersand might work better, presuming it doesn't conflict with standard query parameters.

This would be a bad idea. The script won't be able to read it because the ampersand in URLs "break up" the information in the link. For example...

http://link.com/script.php?food=burger&drink=water

When the script looks at it, the information passed is...

PHP:
echo $_REQUEST['food']; // This would print "burger" to the screen
echo $_REQUEST['drink']; // This would print "water" to the screen

If you wanted to use an ampersand to divide each username using the following URL, you'd end up with a script that doesn't take all the names.

/conversations/add?to=user1&user2&user3

PHP:
echo $_REQUEST['to']; // This would only return "user1"
 
Onimua, see my post for how you would use the ampersand, if one chose that direction.

Ew, such an ugly link! :p I did see it, I was rather expanding upon why using ampersand would be a bad idea on its own. Turning it into an array could be done but it's just a bad approach as you've highlighted.
 
Top Bottom