-1
<?php
if (isset($_POST['generate'])) {
$charset = 'absdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ0123456789%$#-()*&.,';
$generated_password = substr (str_shufle($charset),0, 12);

}
?>
<form action ="password generator" method="post">
<input type="submit" name="generator" value="Generate"><input type="text" value="<?php if (isset($generated_password)) {echo $generated_password; } ?>"/>
</form>

when i click in generate button it show me this:

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404

localhost
Apache/2.4.2 (Win32) OpenSSL/1.0.1c PHP/5.4.4

Edited by mike_2000_17: Fixed formatting

6
Contributors
6
Replies
9
Views
4 Years
Discussion Span
Last Post by yoyo12345
1

Try a better title for your question. And it's 'shuffle'

Edited by diafol

2

This doesn't do anything:

<form action ="password generator" method="post">

It needs to be a proper file path, like:

<form action ="password-generator.php" method="post">
1

Try this

<?php
if (isset($_POST['generator'])) {
$charset = 'absdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ0123456789%$#-()*&.,';
$generated_password = substr (str_shuffle($charset),0, 12);
}
?>
<form action ="" method="post">
<input type="submit" name="generator" value="Generate"><input type="text" value="<?php if (isset($generated_password)) {echo $generated_password; } ?>"/>
</form>
Votes + Comments
This will exactly what andyy121 need :)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.