New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
Yes
What is that script
Pretty simple to use with setenv/mod_rewrite, PHP, Python, heck, even a basic perl script. Shell is also doable with setenv.
My first approach would be to verify a cookie for this. If is set, redirect to url2, otherwise set the cookie and redirect to url1.
You can do this in five lines or so, now go and learn to do it.
I know nothing about PHP
can you please write it
Something like clickjacking?
Depends on what you are looking to achieve with that. Since you have used the word click, you may need JavaScript not PHP
I meant redirecting , not click
No
It should take you a couple of hours to learn this.
@flym,
Oh for crying out loud you can literally just type this into Google to get started: lmgtfy.com/?q=PHP+redirect
As yomero said, you should learn it first rather than asking someone to code it for you for free.
As of solution, use session/cookies and redirect to different page depending on the state.
because i'm feeling nice
https://pastebin.aquilenet.fr/?b77e3761d2a3e54f#xy3Mecb6B66kUIpA7kSB016eTeZBvxCATyf/ETAuh88=
Hate these affiliate sites
header('location: https://google.com')
Or in JS would be cleaner, just have an onclick event to change the href value.
I can do it for you, but you will have to pay $120
Cleaner, and much easier to filter.
If it works with JS I will give it a go myself for learning purposes though given you already have a solution
@pbgen I guess onclick was also what came to my mind first :P
wow thank you mate
i have two questions , if Url1 change to http://1.com how change below code :
isset($_COOKIE['affiliatefraud']) && $_COOKIE['affiliatefraud'] == 'notmalwareredirect
and
after how long cookie will be expired
Look in your php.ini file. It will tell you exactly how long the default session will last.
No call to session_start()? Used to frameworks, are we?
It doesn't use sessions
I realize this, but blindly calling isset() and then referencing the key is going to cause a warning since you did && rather than only calling it after testing (PHP4/5 observed), so I assumed that you either run with warnings disabled, or were doing something else kind of funky.
Also setting the redirect before the cookie doesn't always work with PHP4/5 in my experience, so I would have instead used a session. Perhaps I'm overthinking a bit of throwaway code.
doesn't throw warning or error by default on any of my installs
does ('php notice')
I'm not entirely sure what but I'm new to php and have only used 7.x
That'll be why.
A good form to use when starting with PHP is to set notices for E_ALL so you learn different caveates, and don't pick up bad habits. A buddy of mine from the PHP3 days used to create arrays like @array[foo], instead of $array['foo'], et al, because it didn't care- and is still struggling to unlearn bad habits a decade later.
If you are serious about PHP, you will learn that things that DO work, don't always work. Even my use of sessions won't always work, if the client is set to drop identifiers and the host has no way of storing them in SHM or temp files.. but then again, if that happens, that is a very, very broken host.
[code]
if (@isset($_COOKIE['test'])) THEN {
if ($_COOKIE['test'] == '...' ) [...]
}[/code]
The above is proper, because you are testing if it is set. If you don't, it then goes
[code]
if (@isset($_COOKIE['test']))
AND
if (NULL['test'] == '...' ) [...]
}[/code]
That's why it throws a notice.
Well, I saw that one coming just by looking at the topic.
It's best to simply be upfront about your intentions from the beginning. It would probably save all of us some time and avoid some of the usual LET sarcasm.
That's unfortunate! I've come from PHP3 days as well but managed to keep up with best practices as they developed. I will admit though that I still have some silly habits that are related to early PHP optimization techniques e.g. Using single quotes with strings since double quotes would invoke additional variable substitution routines
No it does't, short-circuit evaluation
That's how it's supposed to work, yes. The logic, however, is wrong.
If ($foo["bar"]) AND (if $foo["bar"] == "baz")
Not only asks if $foo["bar"] is set, but secondarily requires the test due to the && stanza, so it HAS to be evaluated, whether $foo["bar"] is set, or not.
Please test the above in PHP 5.x (or whatever), and note that you'll still get the notice because it is still trying to evaluate the unset $_foo['var'] for the example.
To do this without PHP possibly bitching, you need to do:
if (isset($foo["bar"])) {
if ($foo["bar"] == "..."
}
I actually corrected my assertion above and gave @vedran credit for being technically correct- if it worked that way, but this is actually a known logical issue that plagued PHP from the 5.x days. You can't use && for shorthand when testing for, then testing the same thing and expect it to not be evaluated when it's part of the initial testing...
I don't get a warning or notice at all with even error_reporting(-1), not sure why.
As per my knowledge, I guess you'll find your ans over here https://www.cyberciti.biz/faq/php-redirect/.
In the above link, you'll also gain deep knowledge for redirection