I'm trying to do this dynamic variable thing based on the targets, but it keeps echo-ing the 1st variable only regardless of the target's value (ie domaina, DomainA).
Here's my code:
[PHP]<?php
$dyn1 = $_GET['target'];
if ($dyn1 == "domaina.com"||".domaina.com"||"domaina.co")
{$dyn2 = 'domaina';
$dyn3 = 'DomainA';
}
elseif ($dyn1 == "domainb.com"||".domainb.com"||"domainb.co")
{$dyn2 = 'domainb';
$dyn3 = 'DomainB';
}
elseif ($dyn1 == "domainc.com"||".domainc.com"||"domainc.co")
{$dyn2 = 'domainc';
$dyn3 = 'DomainC';
}
else {$dyn2 = 'notargets';
$dyn3 = 'NoTargets';
}
?>[/PHP]
What did I type wrongly?
On the same note, is there any way I can echo a target that has multiple variations like above (domainc.com, .domainc.com, domainc.co and many more) without manually adding the other variations into the above code?
Yeah , just do it like that :
[PHP]
if(stristr($dyn1, 'domaina') !== FALSE) {
$dyn2="Domaina";
}
[/PHP]
replace domaina with the shortest string contained in the target you want ( for example walmart will do for walmart.com walmart.com .walmart etc )
not to bashing you, your php code is all wrong, the logic is totally out as well as the syntax.
How to use "PHP Code" in html? Thank you!