KermMartian wrote:
The passwords don't seem that random at all to me; what's the algorithm?


They are totally random! Why do you say they aren't??

The 'thegame' is a fake image:S
New Utilitie added, a Binary/Decimal converter!

Concerning my password generator, I'm no PHP expert, so I'd like to know if it is possible to make the generated password show up in a textBox. Also, I am aware that there are textFields and Text Area's, which one should i be using? Any piece of code or help would be really helpful.
ScoutDavid wrote:
New Utilitie added, a Binary/Decimal converter!

Concerning my password generator, I'm no PHP expert, so I'd like to know if it is possible to make the generated password show up in a textBox. Also, I am aware that there are textFields and Text Area's, which one should i be using? Any piece of code or help would be really helpful.
There are <input type="text" .../>, which are single-line text input, and there are <textarea>stuff</textarea>, which are multiline text input. You'll probably want something like this in your code:


Code:
<?php
//...stuff...
echo '<input type="text" value="'.$generated_pass.'" readonly />';
//...stuff...
?>


Also, your passwords are only lowercase letters. I would recommend doing something about that.
And numbers would be nice too.
Svenne wrote:
And numbers would be nice too.
Yeah, I was thinking A-Z, a-z, 0-9, and a handful of symbols.
Finished!

www.davidgom.co.cc/random.php

In a few minutes I'll give the user the change to choose strength AND length of password!
ScoutDavid wrote:
Finished!

www.davidgom.co.cc/random.php

In a few minutes I'll give the user the change to choose strength AND length of password!
Much better; now it's something I would use. For what it's worth, though, I'd rather the password generation was being done clientside in Javascript so I wouldn't need to worry if your server was retaining a copy of the passwords generated.
KermMartian wrote:
You'll probably want something like this in your code:


Code:
<?php
//...stuff...
echo '<input type="text" value="'.$generated_pass.'" readonly />';
//...stuff...
?>

You should really escape strings before sending them to the browser. For example, what if the $generated_pass in the above contained a " character? This is especially important with user-generated content; you don't want people to be able to inject script tags into your pages, as that can lead to XSS attacks.


Code:
<?php
//...stuff...
echo '<input type="text" value="' . htmlspecialchars($generated_pass) . '" readonly="readonly" />';
//...stuff...
?>


(This is not aimed at Kerm and is not much of a concern in this instance but it's a good habit to get into; what if you updated the password generator to generate passwords containing " or < symbols in future but didn't update the code to display the password?)
You're right Kerm, but I don't know JavaScript.

PHP Doubt:

If I solve this problem, I'll release the new passgen right away:

I have a list box (you can see it in the website) and a textfield. How can I get the values from these two and use them as arguments in a function.

I have a function that takes two arguments, the arguments are the selected thing in the drop down box and the textfield. How can I get them AS arguments?

(I can get them by using $_GET["name"])
Regarding the converter, could the output be in the appropriate box? Like if I input some decimal number, then it would convert it and put it in the box for inputing binary numbers.
ScoutDavid wrote:
How can I get them AS arguments?

(I can get them by using $_GET["name"])
Didn't you just answer your own question?
KermMartian wrote:
ScoutDavid wrote:
How can I get them AS arguments?

(I can get them by using $_GET["name"])
Didn't you just answer your own question?


No, because I need to use them in the ARGUMENTS of a function, but it was already solved Smile
$return_val = functionname($_GET["name"],$_GET["name2"])..? With all the languages you use, I hope that's no big stretch of the imagination. Shock Also, I hope you're sanitizing your inputs.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement