I was told I needed to validate the tokens below but I’m not sure where to start. I only have public access to the website I’m pulling the data from. Someone explain to me tokens or give an example to get me moving?
Do I need access to the other server?
function send_CAD($number, $street, $website, $f_opts = true){
$year = date('Y', time());
$number = trim($number);
$street = urlencode(trim($street));
$post_data = "__EVENTTARGET=&__EVENTARGUMENT=&".
"__VIEWSTATE=/wEPD...&" .
"__EVENTVALIDATION=/wEWNw...&".
"txtAddrNum=$number&listStDir=&";
...
I’m not sure exactly what you’re asking so here’s the answer in both directions:
If you have a full url that you’re trying to parse, use
parse_url:The above example will output:
If you have only the query part of the url you can use
parse_str:If you have a url that you’re trying to construct use
http_build_query:If you need to do validation on the data, once you’ve gotten it, you can use the built in
filter_inputfunctions with validation/sanitizing options in PHP:https://www.php.net/manual/en/ref.filter.php
https://www.php.net/manual/en/function.filter-input-array.php
https://www.php.net/manual/en/filter.filters.validate.php
https://www.php.net/manual/en/filter.filters.sanitize.php
Example from
filter_validate_arraypage:The above example will output: