k thanks guys, i’ll give it a go
whitespace is cool, i’ll only need it for text fields anyway
also, when someone says searched on google
is it possible to say what your search term was
i know that’s asking a lot
but sometimes the right phrase never comes to mind
There is a query string on the end of that link in post #2 with the search terms used (“many characters”). But you’re right, it helps if people let you know what search terms they used. I don’t always know what terms to search on myself.
nah, that didn’t work
it’s sort of backwards of what i’m trying to do
i am checking to see if there are non-alphanumeric characters except for white space
is there a way to do exceptions in perl regex?
i tried the suggestion
but even with [a-z\s], [\w\s], \w|\s, \w|\s+, nothing
they all still crap on spaces, could i have a setting that’s not set up or something?
i’m running php 5 (installed from binary) on iis
if you do preg_match on $_SERVER[‘HTTP_REFERER’] to see whether its from google, then get the q= part, thats the search terms, you could then mail it to yourself ot add to a database. Heres the script that I use (in the head of a every page)
function referer()
{
$parts=parse_url($_SERVER['HTTP_REFERER']);
if(strstr($parts['host'],"google")) { //if they've come from google
$get=preg_split("#&#",$parts['query']); //get query string of url
foreach($get as $key=>$stuff) { //put into an array of var=value
$data=preg_split("#=#",$stuff);
$get[$data[0]]=$data[1];
unset($get[$key]);
}
if($get['q']) { //if q= was in the query string
$search_phrase=$get['q']; //thats the search terms
if($get['start']) { //if start was set, that indicates what page they ame from
$page=($get['start']/10)+1;
} else {
$page=1; //..otherwise it was page 1
}
$entry_page=$_SERVER['PHP_SELF']; //mark what page they came in on
$query="INSERT INTO google_terms VALUES('".$search_phrase."', '".$page."', '".$entry_page."')";
@mysql_query($query); //put into database
}
}
}