aj123cd Posted September 29, 2011 Share Posted September 29, 2011 I have a web site where users can gain points, when they use my site. For example, if the user spends $10.00 then the user will get 10 points. In my web site there is a list of 10 retails (name). When the user clicks the link it will redirect to retailers website, where user can buy items. How can I find out how much the user has spent on the retailer? Thank you. Quote Link to comment Share on other sites More sharing options...
Nodral Posted September 29, 2011 Share Posted September 29, 2011 You can use a Google app which will search the web and find you tutorials about how to set up a PHP/MySQL driven site, or you can put your hand in your pocket and pay someone on here to write your code for you. Quote Link to comment Share on other sites More sharing options...
Buddski Posted September 29, 2011 Share Posted September 29, 2011 Unless you have access to the "retailers" website (or some sort of 3rd party arrangement), I highly doubt that they will share any sort sales figures with you. Quote Link to comment Share on other sites More sharing options...
the182guy Posted September 29, 2011 Share Posted September 29, 2011 The only way you can find out if the user buys something from the retailer is if the retailer gives you a sales feed. Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 This project is only for demonstration purpose. If the retailer id willing to share the sales information, can you advice me, Thank you Quote Link to comment Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 29, 2011 Share Posted September 29, 2011 when a use signs-up at your site, give them a unique id. create a database where your retailer would have access to insert info. when you redirect them, the retailer is given the unique id with the purchase. on payment, the page would update the database on the users unique id and the amount spend/points. Quote Link to comment Share on other sites More sharing options...
Buddski Posted September 29, 2011 Share Posted September 29, 2011 Well, the way I see it, the retailer will need to know that your website was the source of the visitor (with the use of a url string or something similar, for this purpose we will call it a token). Your links may look like this <a href="http://www.retailer1.com?rtok=23523t23423">Retailer 1</a> 23523t23423 being the unique token for your user/website. That token would need to be kept by the retailer from the start of the visit to the end of the transaction. Once the transaction is made, it could send information back to your server with the token (that your website also understands) and stores the sales information. This is a very rough idea as to how it could be done. Other people may have a different/more elegant solution. Quote Link to comment Share on other sites More sharing options...
xyph Posted September 29, 2011 Share Posted September 29, 2011 Or the retailer could give you an RSS feed of their items. You then recreate their store on your own site, and act as a middleman. User pays you, you pay retailer, retailer ships items to customer. Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 when a use signs-up at your site, give them a unique id. create a database where your retailer would have access to insert info. when you redirect them, the retailer is given the unique id with the purchase. on payment, the page would update the database on the users unique id and the amount spend/points. ZulfadlyAshBurn thank you. this means user retailer nned to enter the sales details, ? Quote Link to comment Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 29, 2011 Share Posted September 29, 2011 this means user retailer nned to enter the sales details, ? no, it is done by through the script itself. the retailer might need to edit the script so they can update your database. Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 Or the retailer could give you an RSS feed of their items. You then recreate their store on your own site, and act as a middleman. User pays you, you pay retailer, retailer ships items to customer. thank u xyph. What is RSS Feed? Taking payment is bad for me. I will spend the money. is there any other way? Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 Thank you.ZulfadlyAshBurn can you kindly write to me the full steps. thank you Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 Thank you Buddski In you method can user visited the retailer today and buys the product in a week later? Quote Link to comment Share on other sites More sharing options...
Buddski Posted September 29, 2011 Share Posted September 29, 2011 If the "token" was stored in a cookie, I don't see why not Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 If the "token" was stored in a cookie, I don't see why not I need to create the cookie and place the cookie in the user system. Then once the sales finished, how can I get the information? thank you. Quote Link to comment Share on other sites More sharing options...
Buddski Posted September 29, 2011 Share Posted September 29, 2011 (keep in mind im making this all up as I go) Once the purchase has been made, the retailers site could run a piece of code that has access into your system. Their code reads the cookie, sees that it is a token from your site, extracts their user information and then runs code on your system. A very crude example: // This is on the retailers confirm page if ($purchase_successful) { $result = include('http://yoursite.com.au/purchase_confirmed.php?site='.$_SERVER['REQUEST_URI'].'&user='.$cookie_user.'&spend='.$order_total); if ($result) { // Credits added to account // } else { // Something went wrong // } } purchase_confirmed.php $spend = mysql_real_escape_string($_GET['spend']); $user = mysql_real_escape_string($_GET['user']); $site = mysql_real_escape_string($_GET['site']); $sql = "INSERT INTO `credits` (user,site,credits) VALUES ('".$user."','".$site."','".$spend."')"; return mysql_query($sql); Or something Edit: I dont even know if it is possible to use the return method on a URL included file.. but it seems logical whilst I was typing it. Quote Link to comment Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 29, 2011 Share Posted September 29, 2011 my coding steps are similar to Buddski Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 Buddski The cookie will be living in the buyer’s machine; with the cookie have a long life time? thank you. Quote Link to comment Share on other sites More sharing options...
Buddski Posted September 29, 2011 Share Posted September 29, 2011 If you tell it to it will.. Unless of course the user deletes it.. Edit: It feels like we are doing homework.. Let us know if we get a good mark Quote Link to comment Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 29, 2011 Share Posted September 29, 2011 You can alternatively store it your database. Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 You can alternatively store it your database. 1.How can I do that? 2.How the retailer will access this info? thank you Quote Link to comment Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 29, 2011 Share Posted September 29, 2011 The same method by instead of using cookie, store it in the db. The retailer can also access this db. Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 The same method by instead of using cookie, store it in the db. The retailer can also access this db. true. thank you. Buddski, ZulfadlyAshBurn, xyph Thank you very much for all you help. Apart from this method can you or anyone else think of any other method I can use? Thank you. Quote Link to comment Share on other sites More sharing options...
aj123cd Posted September 29, 2011 Author Share Posted September 29, 2011 The same method by instead of using cookie, store it in the db. The retailer can also access this db. Do I have to give permission to let retailers access my database. Quote Link to comment Share on other sites More sharing options...
ZulfadlyAshBurn Posted September 29, 2011 Share Posted September 29, 2011 create a user only for add entry and delete entry. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.