Hello,
I have a question about a simple php script that a friend gave me but I can't reach him right now so I'm posting here to see if any one can help me.
I want a webpage to display a specific ID that is in a link code on a page in a specific %.
For example someone links to my page like that:
http://www.mydomain.com/?s=ABC
The code on the page is (should show in 75% of the case "ABC" and 25% of the case "MYNUMBER"):
<?
srand(time());
$random = (rand()%4);
if($random < "3")
{
$link = "$s";
}
elseif($random == "3")
{
$link = "MYNUMBER";
}
?>
the link code on the page looks like that:
My question: How do I need to change the following code:
<?
srand(time());
$random = (rand()%4);
if($random < "3")
{
$link = "$s";
}
elseif($random == "3")
{
$link = "MYNUMBER";
}
?>
so it shows the ID's like following
40% of time my ID ("MYNUMBER") - 60% of time the ID of the person that is linking to the site ("ABC")
50% of time my ID ("MYNUMBER") - 50% of time the ID of the person that is linking to the site ("ABC")
35% of time my ID ("MYNUMBER") - 65% of time the ID of the person that is linking to the site ("ABC")
Thank you very much for all answers.
Toni