| View previous topic :: View next topic |
| Author |
Message |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Sat Apr 17, 2004 10:28 am Post subject: Referer for websites (Program Refer) |
|
|
VDS 4
Is there a way to let a website know "Your program Refered the user there" as in a link in the program sent them there? _________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sat Apr 17, 2004 10:35 am Post subject: |
|
|
You can set the user-agent to something and then check the user-agent
on the server side.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sat Apr 17, 2004 10:40 am Post subject: |
|
|
oh _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Sat Apr 17, 2004 10:49 am Post subject: |
|
|
1st.. Thank you for a VERY VERY fast reply
2nd..
Yes it opens a browser window. so
| Code: | | http://www.myserver.com/mywebsite/index.php?referer=MyProgram |
Should work right?
Edit..
What if it isn't php? Would it still work? _________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sat Apr 17, 2004 10:55 am Post subject: |
|
|
Yes, that will work. The ?referrer=MyProgram will only appear in the site's
log file, unless the owner of the site uses PHP code to log the action.
For example:
| Code: | <?php
// Call an include file to connect to the database
require("main.php");
// Obtain referrer
$referrer = $HTTP_GET_VARS['referrer'];
// Record referrer in database
$result = mysql_query("INSERT INTO `referrers` (`id`, `referrer`) VALUES ('', '$referrer');");
// Output the rest of the page
include("other_page.php"); |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sat Apr 17, 2004 4:11 pm Post subject: |
|
|
If you don't want to use PHP, you could also parse the stuff out by using Javascript to get the website location:
| Code: | <script>
window.alert(location.href);
</script> |
I don't know the exact Javascript functions you'll need, but they must be like "substring" and "strpos"...  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
|