Forum Moderators: coopster
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Do I need to encode the URL using url_encode() or ??
<?
/* Use this to start a session only if the UA is *not* at search engine
to avoid duplicate content issues with url propagation of SID's */
$searchengines=array("Google", "Fast", "Slurp", "Ink", "Atomz", "Scooter", "Validator");
$is_search_engine=0;
foreach($searchengines as $key => $val) {
if(strstr("$HTTP_USER_AGENT", $val)) {
$is_search_engine++;
}
} if($is_search_engine==0) { // Not a search engine
/* You can put anything in here that needs to be
hidden from searchengines */
session_start();
} else { // Is a search engine
/* Put anything you want only for searchengines in here */
$foo=$bar;
} ?>
You can use it to include the 'Validator' as well.
Nick
So what Nick gave me is a chunk of code that identifies the validator before the session is enabled and prevents the session from starting. Which prevents the SID from being appended. Which, as far as the validator is concerned, is perfect. It only needs to look at my structure and content - not the variables I pass on the URL. Make sense?
One very common use of cookies is to store just an unique id for the user that relates to a databse record containing all of the users preferecnces/data.
Nick
I have never used anything other than premade scripts
If the link is generated by the PHP's session module, you can fix it by putting this in your php.ini:
arg_separator.output = "&"
If you don't have access to or don't want to use php.ini you can modify this setting in the very beginning of your script instead:
ini_set('arg_separator.output', '&');
Hope this helps.
- Stig