# in query string breaks php GET -
running problem form have built. user typed in hash (#) address in address field. when address put query string after form submitted of variables broke after field #. know why happen? need convert # different character or use other type of encoding? code have on page grabs values query string..
<?php echo $_get["address"]; ?><br/> // if field has # in value, variables below not work.. <?php echo $_get["city"]; ?><br/> <?php echo $_get["state"]; ?>
a #
valid anchor symbol in url , has meaning client browser.
in likelihood should using post form rather get, @ point issue goes away.
usually rule of thumb use url parameters (get) cases want url navigable user , such navigation not change data on server (or things trigger emails, etc.). example of might use of product id's in url e-commerce catalog application determine product show on page.
you should typically use post cases going change data on server or trigger action basic navigation page should not trigger. building on earlier example of e-commerce app, might typically use post add item users shopping cart.
Comments
Post a Comment