Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to capture unset REQUEST values in PHP
  2. [CONTENT_TYPE] => application/x-www-form-urlencoded
  3.  [QUERY_STRING] =>
  4.        
  5. $pos=strpos($_SERVER["QUERY_STRING"], 'xml');
  6. $xml="";
  7. if($pos!==false){
  8.     $xml = substr($_SERVER["QUERY_STRING"], $pos+strlen("xml="));
  9. }
  10.        
  11. if (count($_GET)>1 or is_not_well_formed_xml($_GET['xml'])) {
  12.    $xml = substr($_SERVER['QUERY_STRING'], 4);
  13.    if (is_not_well_formed_xml($xml)) {
  14.        really_fail();
  15.    }
  16. }
  17.        
  18. <root><link href="http://example.org/?querystring#fragment"/></root>