View Single Post
  #8 (permalink)  
Old 07-12-2006, 04:40 AM
speed speed is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 833
speed RepRank 1
Default Re: php referrer problem

Quote:
Originally Posted by bloxar
<form name=”myProductForm” method=”post” action=”my_pdetails_form_.php” >

<input type=”hidden” name=”ref” value=”<?php echo $ref; ?>”/>
This only works if register globals is set to on.

To make it work with register globals off replace echo $ref; with:

echo $_SERVER['REQUEST_METHOD'] == 'POST ? $_POST['ref'] : $_GET['ref'];

Or use $_GET on the 1st form and $_POST on the subsequent forms.
Quote:
Note: if you want to track from where the form was called o you want to perform a little bit of security stuff use something like this $called_from= getenv('HTTP_REFERER'); this will output the referred url from your form was requested.
This is not always true, users of certain firewalls will block this information and therefore you cannot rely on it being present.
__________________
TOLRA Micro Systems Limited US & UK Web Hosting with Continuous Data Protection
Web Directory 2 for 1 Offer : Web Directory Script
Reply With Quote