How can I get Infusionsoft's Cookie Info from this URL - php

Infusionsoft provides the following script / method of obtaining an affiliate ID. Now, I want to call that URL programmatically and just get back the affiliate ID - I don't want to redirect or go anywhere else, I just want the affiliate ID to use in a following query. I know there has to be a way to do this, but I have no idea what it might be...
--
Here is an example of the modified redirect link URL. You will need to change highlighted sections to enter your Infusionsoft application name and the URL of your destination website.
https://appName.infusionsoft.com/aff.html?to=http://www.example.com
If the prospect clicking on this link has a referral cookie stored on their browser, the partner will land on a page with a URL something like this:
http://www.example.com?affiliate=1234
The destination URL matches the one at the end of the redirect link and the referring partner's ID is part of the URL. If no cookie is found, the referral partner ID number is set to zero.

I think I've looked into doing this before. It seems to me that if you created a page to redirect to, for example, http://www.example.com/affiliateId.php, and on that page you echoed nothing but the affiliate ID, like so:
<?php echo $_GET['affiliate']; ?>
You could simply cURL that page and pull in the response. The problem here is that when you cURL the page, it's actually your server going to the page, and not the user's computer, so it always returns 0.
So, somehow, you need to get the user's computer to navigate to the page, perhaps through the use of an iframe or an ajax call and then pull the information after it's been rendered using a client side script.

Related

Generate a search URL with php and redirect through HTML link

I'm trying to access a search-generated URL without actually going to the search results page. Essentially this is the process I would like to mimic:
go to google
type in "cat toys"
copy the new search-generated URL with all the unique get parameters
Is there a way to send that sort of request through php, receive that URL, then pass that URL into a header("Location: googlePage") function?
So essentially the php would look like this:
<? php
$link = ...get google url...
header("Location: ".$link);
?>
I'm trying to manage a certain web app that gets some of its info from a website that auto generates unique URLs each time the page is loaded. I'm assuming it has to do with time stamps being encoded. So even if you refresh the page, the GET parameters will be different. Time stamps are the only thing I can think of that might change this. Either way, the point of my question is I would like to send the request through php, get that URL and send that new URL to my redirect. Is this possible in some kind of way?

Need tp find Request source URL in PHP

I want to determine the website from which the request to the particular website has been called. For Example..I have a website www.ex.com. Now this website link has been there on three websites www.a.com, www.b.com, and www.c.com. Suppose one user has clicked the link from www.a.com to go to www.ex.com. Now I want to determine that the request has come from the www.a.com and then the page in www.ex.com will be displayed accordingly. Similarly if the user has clicked the www.ex.com link from www.b.com then the page will be displayed accordingly.
So how can I determine this request source, means from which website www.ex.com has been called? It is good if you will explain this using code in PHP.
Thanks
Look here for HTTP_HOST and HTTP_REFERER.
Since both global variables are populated from HTTP headers, look also here for Host and Referer.
That's how you use them:
$host = $_SERVER['HTTP_HOST'];
$referer = $_SERVER['HTTP_REFERER'];
The 1st is the original host name (like 'www.a.com') referring to your page. The 2nd is the full URL (like https://www.a.com/some/path/to/some.html).
Then, based on some conditional logic, you may return to your users appropriate HTML.
There are two different websites.
Say from a.com, you click on ex.com
So, for the link in a.com, add some parameter:
Click Here
Now, your from parameter will be
1) a.com
2) b.com
3) c.com
If none of the above, then its clicked from ex.com itself.
You can also add some encryption for this link to add security.
You can use this
$_SERVER['HTTP_REFERER']
for referral url

Facebook Page Tab does not forward

I implemented a Facebook Like Status Request on my Page Tab but if I want to click on the "next"-Link (to see index.php?action=step2) it loads the page that pops up if Like Status = Not Like. If I want to link to http://www.google.de the Page Tab doesn't load any page at all. What am I doing wrong?
I'm assuming you're detecting if the user likes your page or not via the signed_request parameter POSTed to your app's page
If so, any links the user clicks inside the iFrame containing your app will be GET requests to a different URL which will not contain the signed request with the like data - you'll need to use your own mechanism (e.g. cookies, url parameters) to pass the 'like' information from the first to second page of your app

How To Tracking URL Link in other website

I want to know how to programming the script for tracking purpose.
Such as I put the link on my blog, and I can know which IP or which website is using my URL Link on their website?
I have a live price url that retrieved from my own database.
E.g. www.example.com/live_price.php
It is only display data in table format, where data are dynamically selecting from my database.
This URL Link exposes to other people put onto their website. Example in iFrame or other method to exactly display the link on website.
In short: you can't.
You can't know which website uses your link because the person hitting the link is the home user, not your website.
A home user hits http://mywebsite.com/ which returns an HTML document containing a link to an image off your website. From your point of view, you just see a user downloading the image off your website. There is no way for you to find out that he heard of the link from http://mywebsite.com/.
In php you can check the value of $_SERVER['HTTP_REFERER'] to see where a user is coming from.
In php you can try $_SERVER vars
Using $_SERVER['REMOTE_ADDR'] you can see the ip of the system from which your site is being addressed.
$_SERVER['HTTP_USER_AGENT'] you can check the user agent .
check for more $_SERVER vars here

Get url of the page in php

I am working on "Email this page" Popup page. I want to send url of base page as an email, but it should be a popup window.
I have used HTTP_REFERER, it is working fine on Firefox, but not working on Internet Explorer.
I am getting the url of current page but I want that url in new popup window page.
Is there any alternative than HTTP_REFERER.
On the page you wish to grab the URL of, you can use $_SERVER['REQUEST_URI'] to get the requested URI (except the scheme & hostname; in other words, you get the path and query string). Pass this to your other page either using a query string or sessions. The former is preferable, as the latter isn't RESTful. There may be times when it's OK to break REST's rule against server side state, but this probably isn't it.
There is no way unless you store it or send it yourself. This page has one example of how to do it, but only really if you set it beforehand. If the site is your own then you should be ok. If not then you will struggle.
That happens because the HTTP_REFERER is sent by the client browser, which means that it's value can be totally manipulated or can even be null. This means that this variable isn't very reliable. But if the site is yours, there are other solutions.
You can send the url or any other identification like an ID by QueryStrings. So you'll have the link URL like this the_send_page_name.php?ref=index.php
Be aware that this method only works if you're opening the Pop-up in a site that's yours.

Categories