I think I may need to learn a bit more for this.
Thankyou very much for the code, I tried to implement it into a page using
<?php
$ltrs = "ABCDEFGHJKLMPQRS";
$name = $_POST['name'];
$one = rand(0, strlen($ltrs)-2);
$str = $ltrs[$one];
$ltrs = substr($ltrs, 0, $one).substr($ltrs, $one+1); // remove this letter, it can't be used again
$two = rand($one, strlen($ltrs)-1); // must come after $one
$str .= $ltrs[$two];
$ltrs = substr($ltrs, 0, $two).substr($ltrs, $two+1); // remove this letter, it can't be used again
$three = rand(0, strlen($ltrs)-2);
$str = $ltrs[$three];
$ltrs = substr($ltrs, 0, $three).substr($ltrs, $three+1); // remove this letter, it can't be used again
$four = rand($three, strlen($ltrs)-1); // must come after $three
$str .= $ltrs[$four];
return $str;
$code = $one.$two.$three.$four;
?>
<html>
<head>
<title>Random Code Generator</title>
</head>
<body>
<?php
echo "Ref. Name:" .$name. "<br />"; // prints name
echo "Code:" .$code. "<br />"; // prints code
?>
</body>
</html>
$name is a variable from a form which is connected to the php doc.
But the page just returned blank. Any more help would be very much appreciated.
Sorry for any nooby mistakes I may have made.