YES! I think it would be very worthwhile to modernize the scripts. I can't be the only one using it. Everything fancy on my sites came from DD. A few years back I asked John Scheuer if there were a responsive version of the Swiss Army slideshow and he asked me if I could help him do it by providing feedback, which I would love to do, but I did not have a cell phone at the time. Right now I have a loaned cell phone of someone who owes me money so I could now provide feedback on how it looks on a cell phone. I am eager to do whatever I can to help but my knowledge of php is limited even though I try to learn as much as I can. You wouldn't believe how long it is taking me to write that login script you helped me with because I couldn't find a good one online. I use this little script I found years ago to generate a verification code to send to someone registering for an account, but the value keeps disappearing. It works when I test it separately but then within the file it gives no value. It is making me crazy. Back to getpics.com, I do a website for my HOA with lots of slideshows of landscaping photos (I am Board Pres but also do the landscaping as a volunteer). It is also a way for me to keep the photos organized so I love to have the slideshow at the top with the thumbnails below that can be blown up by clicking the thumbnail. Love seeing the before and after pics.
Is there something the matter with this script below? It was for generating passwords but in this case I just need an email verification code.
Code:
<?php // Generate a random password
function generateVerify ($length = 6){
$verify = ""; // start with a blank password
// define possible characters - any character in this string can be picked for use in the password,
// so if you want to put vowels back in or add special characters such as exclamation marks, this is
// where you should do it
$possible = "1234567890";
// $possible = "2346789abcdefghjkmnpqrstvwxyzABCDFGHJKLMNPQRTVWXYZ";
// we refer to the length of $possible a few times, so let's grab it now
$maxlength = strlen($possible);
// check for length overflow and truncate if necessary
if ($length > $maxlength) {
$length = $maxlength;
}
$i = 0; // set up a counter to track how many characters are in the password so far
while ($i < $length){ // add random characters to $password until $length is reached
$char = substr($possible, mt_rand(0, $maxlength-1), 1); // pick a random character from the possible ones
if (!strstr($verify, $char)) { // have we already used this character in $password?
$verify .= $char; // no, so it's OK to add it onto the end of whatever we've already got...
$i++; // ... and increase the counter by one
}
} // done!
return $verify;
}
//$vcode = generateVerify ();
//echo "Vcode: " .$vcode. "<br>"; echo "Verify: " .$verify;
?>
Then in the registration script I have this...
Code:
include('vcode-generate.php');
$vcode = generateVerify ();
But it shows no value except when I echo the value in the vcode-generate.php file. It makes no sense to me. As always, any help will be greatly appreciated. It is for a community calendar I have inherited from a former client. I have been trying to retire but find I am doing even more work now with the only difference that I no longer get paid lol. aa
Bookmarks