Single redirect for homepage, php code

Talk about scripts, analytics, API, software, and shrinkers here.
Forum rules
WARNING: Tools in this forum are being supported or maintained by the original author and not Adf.ly Staff. Proceed at your own risk.
Post Reply
psysim
Newbie
Posts: 3
Joined: Sat Jan 18, 2014 4:38 pm

Single redirect for homepage, php code

Post by psysim » Sat Jan 18, 2014 4:46 pm

Hello, first post for me, sorry in advanced if its in the wrong section or confusing to read.

The problem is, with my small snippet of code, is its looping through adf-ly again and again, which will just make people leave the site all together. In brief, I am trying to add some php to an existing wordpress to redirect it through adf-ly once per person, per visit. The idea is this...

visit the page > go through adf-ly after 5 seconds just the once > return to page

Here is my code :

Code: Select all

if (!isset($_SESSION['adflyused'])) 
{
	header( "refresh:5;url=[LINK REMOVED FOR FORUM]" );
	$_SESSION['adflyused'] = true;
}
My question is, whats my mistake? I'm quite new to php. Any help would be gratefully appreciated.

Thanks, Simon.

idooeditor
Banned
Posts: 1
Joined: Wed Jan 22, 2014 1:11 am
Contact:

Re: Single redirect for homepage, php code

Post by idooeditor » Wed Jan 22, 2014 1:17 am

*removed*

psysim
Newbie
Posts: 3
Joined: Sat Jan 18, 2014 4:38 pm

Re: Single redirect for homepage, php code

Post by psysim » Thu Jan 23, 2014 7:10 pm

Well thanks for the 'subtle spam', I'm sure hundreds of people are racing to find out more.

Anyone got any constructive advice?

User avatar
Xellon
Adf.ly Legend
Posts: 4170
Joined: Tue Feb 21, 2012 12:10 am
Location: Somewhere in a distant land

Re: Single redirect for homepage, php code

Post by Xellon » Thu Jan 23, 2014 7:30 pm

Topic moved to tools.

Did you try the adf.ly entry script? You can set it so visitors will only view the ads once as long as their cookies are enabled. change the var frequency_cap to 1.

Please note rule 11 in our TOS
It is permitted to automatically redirect to an AdF.ly link only with a HTTP Redirect (unless using one of our preapproved scripts, available on the AdF.ly website). JavaScript redirect or meta-refresh is not allowed.

dicim
Newbie
Posts: 8
Joined: Tue Sep 10, 2013 11:43 am

Re: Single redirect for homepage, php code

Post by dicim » Fri Jan 31, 2014 4:41 pm

I'm in the same problem, you got a solution?

psysim
Newbie
Posts: 3
Joined: Sat Jan 18, 2014 4:38 pm

Re: Single redirect for homepage, php code

Post by psysim » Fri Jan 31, 2014 5:34 pm

Thanks Xellon, that is useful, and thanks for pointing out the TOS, I didn't realise but now do!

dicim, the solution is as Xellon posted. You'll find an api/script link on your summary page.

dicim
Newbie
Posts: 8
Joined: Tue Sep 10, 2013 11:43 am

Re: Single redirect for homepage, php code

Post by dicim » Sat Feb 01, 2014 4:57 pm

I meant that if there is any way to not have to put link, if not the same devolviese you to where you were.
If there is some system to replace eg
([LINK REMOVED FOR FORUM)
by a single code to do the work, the only

GeorgeOn
Newbie
Posts: 1
Joined: Wed Mar 02, 2016 12:13 pm

Single redirect for homepage php code

Post by GeorgeOn » Sat Mar 05, 2016 11:46 am

Not using a responsive web design is a mistake. Dont you want to have a nice website for small screen devices?

Post Reply