PDA

View Full Version : Deciphering Querystring in PHP


Socraties
08-20-2002, 06:51 PM
If i have a query string that looks like this:

clientacct=CL00&clientid=1234&service=SA00&rate=F&monthly=900.00&contacts=1000&setupfee=250&acctcode=0123456789&setupdte=20020820&otherservice=NN&curr_service=EXPRESS

How can i decipher what those values are without acutally knowing what they are?

I need to know what they are because they can be variable length, so I won't be able to simple do a substr() on them. Can I do something like $key=$value? or does php have a function that easily allows you to decipher querystrings?

firepages
08-21-2002, 12:29 AM
parse_str ... with your example...


<?
parse_str($_SERVER['QUERY_STRING']);
//eg

echo $clientid.' '.$service;//etc
?>



note that the value of $monthly would probably end up as '900_00'