BrianM Posted June 11, 2008 Share Posted June 11, 2008 What are the differences in some symbols contained in a query string, like & and ; .. when should each be used and what for? Quote Link to comment https://forums.phpfreaks.com/topic/109807-query-string-differences/ Share on other sites More sharing options...
BrianM Posted June 11, 2008 Author Share Posted June 11, 2008 I just found this on another website - The question mark indicates the start of the query string and the ampersand, &, symbol seperates variable=value assignments. ... but, what does the ; symbols do and when should it be brought into play? Quote Link to comment https://forums.phpfreaks.com/topic/109807-query-string-differences/#findComment-563509 Share on other sites More sharing options...
.josh Posted June 11, 2008 Share Posted June 11, 2008 query as in sql query string or are you talking about what you see in your url bar? Quote Link to comment https://forums.phpfreaks.com/topic/109807-query-string-differences/#findComment-563514 Share on other sites More sharing options...
BrianM Posted June 11, 2008 Author Share Posted June 11, 2008 What you see in the URL. Quote Link to comment https://forums.phpfreaks.com/topic/109807-query-string-differences/#findComment-563516 Share on other sites More sharing options...
Darklink Posted June 11, 2008 Share Posted June 11, 2008 After the filename like: http://www.example.com/index.php?act=test&do=something The ? indicates the start of the query and the & is the seperator between each paramater. So the URL above would return the following $_GET array: [act] => test [do] => something The use of ; in a URL is not really used as far as I am now unless you are parsing that as one of the parameter values. A common mistake is the use of & in a URL when redirecting via JavaScript. This would accidently represent the URL above like so: http://www.example.com/index.php?act=test&do=something However if you do use & to seperate URL's in HTML (which you should) it would take you to: http://www.example.com/index.php?act=test&do=something Quote Link to comment https://forums.phpfreaks.com/topic/109807-query-string-differences/#findComment-563523 Share on other sites More sharing options...
BrianM Posted June 12, 2008 Author Share Posted June 12, 2008 Ah, well thank you for the information. Quote Link to comment https://forums.phpfreaks.com/topic/109807-query-string-differences/#findComment-563538 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.