identify HTML page using PHP -
is there way identify different html pages using php, example want know page data submitted can make logic using php,
if had example.html & example2.html pages both submitting logic.php, if data comes example.html
$data = array(); $data['template'] $_post['example']; $data['template'] $_post['example2'];
so logic
if(logic){ $data['template'] $_post['example']; }else{ $data['template'] $_post['example2']; }
but not sure how identyfie particular pages
either include hidden field form
<input type="hidden" name="hiddenfield" value="example1">
and
if($_post['hiddenfield']=="example1") { } else { }
or use referer
if(substr_count($_server['http_referer'],"example.htm")) { } else }
http://www.php.net/manual/en/reserved.variables.server.php
'http_referer' address of page (if any) referred user agent current page. set user agent. not user agents set this, , provide ability modify http_referer feature. in short, cannot trusted.
both have pros , cons, , both can of course faked user...
Comments
Post a Comment