Page 1 of 1

How to make a closed loop reporting php?

Posted: Thu Jun 01, 2006 3:23 pm
by lucas20042004
My site: ipods.thefreegiftnetwork.com offers free gifts for people who complete offers such as trials and things. I want to make it so when someone completes an offer this reflects in the users area on my site. On revenue universe (an affliate program), it says when someone completes an offer it sends this back to my site:

http://ipods.thefreegiftnetwork.com/clo ... status=xxx".

campaign: The offer ID number of the offer being posted.
name: The name of the offer being posted.
sid: The userid that you passed to the campaign.
status: This will be either 1 or 2, for completed or not completed, respectively.

So I need to make a closedloop.php, so when revenueuniverse sends the command to it, it will update on my site.

I doubt anyone will know what im on about but its worth a try.. Thanks

Posted: Thu Jun 01, 2006 3:30 pm
by PrObLeM
1. Have it pull the variables from the query string. (using $_GET)

2. Update the database

3. Output the info on the page.

Posted: Thu Jun 01, 2006 3:31 pm
by lucas20042004
Thanks for the quick reply but I havent got a clue about writing php..

Posted: Thu Jun 01, 2006 3:40 pm
by PrObLeM
this is a simple version just to help you get started

Code: Select all

<?php
//this page will insert into database
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password') or die(mysql_error());
mysql_query("INSERT INTO database (`campaign`, `name`, `sid`, `status`) VALUES($_GET['campaign'], $_GET['name'], $_GET['sid'], $_GET['status'] )");
?>

Posted: Thu Jun 01, 2006 4:06 pm
by lucas20042004
Hi, ok I think I have nearly got it but could you help me edit that script.

The table name is "irs_coffers"

The column name for the SID is "could"

The column name for status is "coStatus"

Please could you edit it for me. I dont need the offer name or campaign bit in it anymore.

Thanks