HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media


Welcome to TinyPortal. Please login or sign up.

March 03, 2024, 07:29:10 PM

Login with username, password and session length
  • Total Members: 3,881
  • Latest: fords8
  • Total Posts: 195,080
  • Total Topics: 21,209
  • Online today: 66
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 55
  • Total: 55

random password

Started by superQ, February 25, 2006, 03:48:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I found ths snippert and was wondering if it can be used in a php block. I have it here ,but it don't work right.

the code in the block is.

/** * The letter l (lowercase L) and the number 1
* have been removed, as they can be mistaken
* for each other. */
function createRandomPassword()
{    $chars = "abcdefghijkmnopqrstuvwxyz023456789";    srand((double)microtime()
*1000000);    $i = 0;    $pass = '' ;   
while ($i <= 7) {        $num = rand() % 33;       
$tmp = substr($chars, $num, 1);       
$pass = $pass . $tmp;        $i++;    }   
return $pass;
// Usage$password = createRandomPassword();
echo "Your random password is: $password";

you can see this eror right on the page.

Parse error: parse error, unexpected '<' in /home/rockstar/public_html/smf/Sources/Load.php(1607) : eval()'d code(34) : eval()'d code on line 1


Ranodom password in a Block ?

Isent that mod made for users that have forgotten their passwords and need to be sended one trough email?

If im wrong there my apologys.

The first thought when i saw your code was if you try that in a Block. remove the php tags <?php and ?> in the start and end of the code then paste it in a PHP block


this is what it said.Random password generator.

I didn't write that :uglystupid2:Will remove the tags.Thanks.


works better but where is the pw.


make sure the variable $pass is not used in SMF. Also I do not see $password defined.

// Usage$password = createRandomPassword();
echo "Your random password is: $password";

// Usage
$password = createRandomPassword();
echo "Your random password is: $password";

And see if that helps.



Must be for a Guestbook.. yes?


I don't know.I guess it is not to usefull. I personally use Password scrambler. I just found that place and it looks like a lot of stuff that may be useful to go into blocks.  I am interested in that flashchat in articles thing though.Soon as I save up $5.00. ;)


There is a Free one also..

forgot the's in here someplace..

Simply search?