Forum Moderators: coopster

Message Too Old, No Replies

javascript / php

is it possible?

         

c0nsur

7:55 pm on Aug 6, 2003 (gmt 0)

10+ Year Member



lets say i have 2 web sites on 2 different server...

server one
----------
people come and see index.html

now can i tell java script to start a php function in server two to execute a special thing like

grab referer and searched keywords in url for page one

!

vincevincevince

9:28 am on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



short answer: not easily / nicely

suggestion: do it all in javascript
ie for the referrer use javascript object "document.referrer"
and for the searched keywords parse them out of the string?

panic

6:24 pm on Aug 7, 2003 (gmt 0)

10+ Year Member



Parsing the keywords is going to entail making a definition for each engine. Have fun with that :P

-panic

vincevincevince

9:36 pm on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



going to entail making a definition for each engine

Or just grab any word after an =, which depending upon application could be quite good enough.

panic

9:55 pm on Aug 7, 2003 (gmt 0)

10+ Year Member



Now ideally, that would work. But, the query string passes back tons of values. For example :

[google.com...]

[hotbot.com...]

[looksmart.com...]

[alltheweb.com...]

Most pass back the query as q=* , but not always. In which case, you'd have to setup definitions for each engine.

-panic

c0nsur

2:16 am on Aug 8, 2003 (gmt 0)

10+ Year Member



thanks ive already made every description var for hundreds of search engines to find query var :)

that was long but it worth it!

GeorgeGG

5:08 am on Aug 8, 2003 (gmt 0)

10+ Year Member



////////
Server1 index file:

// make all on one line
<script TYPE="text/javascript">
document.write("
<script type=\"text/JavaScript\" src=\"http*//your.domain/js.php
?URL=
"+escape(document.URL
?server1_url=document.URL
:server1_url="UnKnown")
+"&REF=
"+escape(document.referrer
?server1_ref=document.referrer
:server1_ref="UnKnown")
+"\")\"></"+"script>");
</script>

////////
Server2 js.php file:

<?php
header("Content-type: application/x-javascript\n\n");
foreach ($GLOBALS as $key=>$value)
{
if($key == "URL")
// The key 'URL' will contain the server1 index page
// URL and any variables/query string on the URL line
if($key == "REF")
// The key 'REF' will contain the referrer to the
// server1 index page if known and any variables/querys
// string
}
?>

////////
This is part of my data that I'm using to parse by,
I parse for up to 3 querys.

Format:
domain¦ignore this column¦1st parse¦2nd parse¦3rd parse¦

translate.google.com¦googlr.ref¦u¦q¦¦
216.239.32.1-216.239.63.1¦google.ref¦q¦query¦as_q¦
most google¦google.ref¦q¦query¦as_q¦
//
most hotmail¦hot-mail.ref¦hm___action "=URL"¦hm___action¦¦
//
abcsearch.com¦abcsearch.ref¦Terms¦¦¦
about.com¦about.ref¦terms¦¦¦
alexa.com¦alexa.ref¦q¦¦¦
allsearchengines.co.uk¦other.ref¦query¦¦¦
allthesites.com¦allthesites.ref¦query¦¦¦
alltheweb.com¦allthewe.ref¦q¦query¦¦
altavista.com¦altvista.ref¦q¦¦¦
aol.com¦aol.ref¦query¦¦¦
ask.co.uk¦askjeeve.ref¦qry¦pt¦ask¦
ask.com¦askjeeve.ref¦qry¦pt¦ask¦
askjeeves.com¦askjeeve.ref¦qry¦pt¦ask¦
atomica.com¦atomica.ref¦s¦¦¦
att.net¦att-net.ref¦gwd¦¦¦
bbc.co.uk¦bbccouk.ref¦q¦¦¦
bellsouth.net¦bellsouth.ref¦string¦¦¦
cari.com.my¦cari-com.ref¦q¦¦¦
cometsystems.com¦cometsys.ref¦qry¦¦¦
commonname.com¦commonname.ref¦cnqry¦¦¦
directhit.com¦askjeeve.ref¦qry¦pt¦ask¦
dmoz.org¦dmoz-org.ref¦search¦¦¦
dogpile.com¦dogpile.ref¦q¦¦¦
earthlink.net¦earthlnk.ref¦q¦¦¦
eircom.net¦eircom.ref¦search¦¦¦
exalead.com¦exalead.ref¦q¦¦¦
excite.com¦excite.ref¦qkw¦¦¦
fares.net¦fares.ref¦search¦¦¦
find.opasia.dk¦opasia.ref¦q¦¦¦¦
findit.com¦findit.ref¦search¦¦¦
hotbot.com¦hotbot.ref¦query¦¦¦
icq.com¦google.ref¦q¦query¦as_q¦
innerprise.net¦innerprise.ref¦search¦¦¦
iwon.com¦iwon.ref¦searchfor¦¦¦
ixquick.com¦ixquick.ref¦query¦¦¦
kartoo.com¦kartoo.ref¦q¦¦¦
looksmart.com¦looksmart.ref¦key¦¦¦
lukol.com¦lukol.ref¦p¦¦¦
lycos.co.uk¦lycos.ref¦query¦MT¦¦
lycos.com¦lycos.ref¦query¦MT¦¦
lycos.de¦lycos.ref¦query¦MT¦¦
mamma.com¦mamma.ref¦query¦¦¦
metacrawler.com¦metacraw.ref¦q¦general¦¦
monstercrawler.com¦m-crawl.ref¦qry¦¦¦¦
msn.com¦msn.ref¦q¦¦¦
msnusers.com¦msn.ref¦q¦¦¦
munky.com¦munky.ref¦term¦¦¦
mysearch.com¦mysearch.ref¦searchfor¦¦¦
myway.com¦myway.ref¦searchfor¦¦¦
netscape.com¦netscape.ref¦query¦search¦¦¦
ninemsn.com.au¦ninemsn.ref¦q¦¦¦
o2w.d2g.com¦o2w.ref¦searchterm¦¦¦
openfind.com.tw¦openfind.ref¦q¦¦¦
openfind.com¦openfind.ref¦q¦¦¦
overture.com¦overture.ref¦Keywords¦¦¦
passagen.se¦passagen.ref¦q¦¦¦
scrubtheweb.com¦scrubtheweb.ref¦q¦keyword¦¦¦
search.com¦search.ref¦q¦¦¦
searchhippo.com¦hippo.ref¦q¦¦¦
sidesearch.lycos.com¦lycos.ref¦query¦¦¦
sympatico.ca¦sympatico.ref¦query¦¦¦
teoma.com¦teoma.ref¦t¦q¦¦
websearch.com¦websearch.ref¦qkw¦¦¦
websearch.cs.com¦cs.ref¦query¦¦¦
wisenut.com¦wisenut.ref¦q¦¦¦
xtramsn.co.nz¦xtramsn.ref¦q¦¦¦
yahoo.com¦yahoo.ref¦p¦va¦¦

BTW I'm 'not' a PHP or JS person.

GGG

c0nsur

12:44 pm on Aug 8, 2003 (gmt 0)

10+ Year Member



w0w what a nice reply!

you may not be a php or js guy but probably a g00d tecnical guy ;)

thanks all of u for fast help!
really appreciate!

. .::c0nsurrexistis::. .

GeorgeGG

2:26 pm on Aug 8, 2003 (gmt 0)

10+ Year Member



Thanks
Also the '¦ignore this column¦' or '?.ref' are
database files.

google.ref contains info for the 'selm' and 'th' query
and default results.

The 'selm' query:
¦Google Groups
¦From:
¦Subject:
¦Newsgroups:
¦Date:

The 'th' query:
¦Google Groups
¦Subject:
¦Newsgroups:

And the results to go with the default querys:
groups.google.uk/¦Google Groups, United Kingdom
.google.uk/¦Google Search, United Kingdom
etc.

like panic said

tons of values/setup definitions for each engine.

working on it :)
GGG

panic

5:33 pm on Aug 8, 2003 (gmt 0)

10+ Year Member



g00d gamex0r, Ge0rge GG.

-panic