If you want to set a cookie, use setcookie().
h
ttp://www.php.net/manual/en/function.setcookie.php
If you want to find out what website the user came from,
use
$_SERVER['HTTP_REFERER']. http://php.net/rese
rved.variables
If you want the information from another site to be sent to
yours,
provide a form for the 3rd party to use that posts to a url
on your
site. For example:
// Page on 3rd party site
...
<form method="post" action="http://www.yoursite.
com/path/to/
script.php">
// user fills out form
</form>
// script.php on your site
<?php
setcookie('tracker', 'referer=' .
$_SERVER['HTTP_REFERER']);
// now do something with the $_POST variables that came
through with
the form.
// you may want to check out immediately or just start a
shopping
cart and allow
// the user to continue shopping on your site. you could
even send
the user back
// to the referring site. it's up to you.
?>
When the user check's out, you can see where s/he came from
and credit
your referer by
using the $_COOKIE variable: $_COOKIE['tracker'].
Hope this helps,
Jody
On Jun 16, 12:45 pm, Megamoto <duncanell... breathe.com> wrote:
> HI there,
>
> I am trying to develop a system to track sales. When a
user is
> redirected to my site from a partners' website (via a
unique URL), I
> would like to attach a cookie which lets me know that
this user came
> from site X.
>
> When the user fills out a customer information form, I
would like the
> information on which site the user came from to be
included in the
> form. This way if we make a sale we can reward the
affiliated website.
>
> Can anyone assist me in drawing a plan of
action/strategy for
> achieving this or letting me know if there are codes
out there which
> have been writen with what i am trying to do in mind. I
have limited
> knowledge in PHP (i am studying for ZEN).
>
> Thanks
>
> Duncs
--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development
staff at 360 PSG. An enterprise application development
company utilizing open-source technologies for todays
small-to-medium size businesses.
For information or project assistance please visit :
http://www.360psg.com
You received this message because you are subscribed to the
Google Groups "Professional PHP Developers"
group.
To post to this group, send email to Professional-PHP googlegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribe googlegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---
|