Jump to content

Create random text in the middle of a link


eng15ine

Recommended Posts

Hello, I would like to make it so when ever some goes to myserver.net/new it will display a link to  www.anotherserver.com/rese/aos/aos/?efwefe=RANDOM-TEXT-HERE@myserver.net.com&efw=Jodk&wef&system=18410=oh&compver=885455  Where it says RANDOMTEXTHERE in bold I would like to show random text every time the page is accessed.

 

Ive been trying to figure this out for some time, but have no idea.

 

Help would be much appreciated! Thanks in advance! :D

This will produce a random string 20 characters in length:

<?php
$str = substr(str_shuffle(implode("",array_merge(range('a','z'),range('A','Z')))),0,20);
echo $str;
?>

You can make it into a function:

<?php
function randstr($len) {
   return(substr(str_shuffle(implode("",array_merge(range('a','z'),range('A','Z')))),0,$len));
}

echo '<a href="http://www.anotherserver.com/rese/aos/aos/?efwefe=' . randstr(20) . '@myserver.net.com&efw=Jodk&wef&system=18410=oh&compver=885455">text</a>';
?>

 

Just enter the length of the string you want to generate.

 

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.