Showing posts with label Dreamweaver 8. Show all posts
Showing posts with label Dreamweaver 8. Show all posts

Saturday, 10 April 2010

How to generate random passwords for PHP users.

Hey guys.

I have a script that I'd like to share and it is about generating random password. You can very well use this script for your new user registration. And then mail it to them.

This is useful when people create accounts and have easy to remember passwords but passwords shouldn't be easy to guess. Therefore, this script is going to output something that will be hard for user to guess.

Here it is:

function GeneratePassword($min = 5, $max = 8) {
$ValidChars = "abcdefghijklmnopqrstuvwxyz123456789";
$max_char = strlen($ValidChars) - 1;
$length = mt_rand($min, $max);
$password = "";
for ($i = 0; $i < $length; $i++) {
$password .= $ValidChars[mt_rand(0, $max_char)];
}
return $password;
}
echo "New Password = " . GeneratePassword()
. "\n";
echo "New Password = " . GeneratePassword(4, 10) . "\n";




Now all you have to do is call this function and you are there!

Enjoy!

Saturday, 3 April 2010

What is PHPinfo() ?

When you are working with PHP, this is the all important question!

Basically, this is a function, a built-in function I might add is having all the info about your web server.

It lets you know where you configuration file is stored (i.e. the php.ini file) and the version of PHP you are using.

Not only that, the information about the session variable the cookies and much more. Not to mention it also lets you know what extensions are loaded in the server. What extensions are in PHP, I will let you know in my next post.

Keep reading and keep tuned in!

Thanks!

Wednesday, 11 April 2007

Setting up Database in Dreamweaver 8 without writing any codes

It is again quite easy to setup your database using your favourite Dreamweaver 8 without writing any codes . If you are working with PHP4 or PHP5 you can always set it up smoothly as possible.
I would assume that you have already opened up your favourite Dreamweaver 8. Get ready for easy step-by-step learning!
If you are working with PHP then the way to select it is by going to the File-> New and then selecting PHP the way it is shown below in the picture



Now to setup, yes to setup the database (Here we are using MySql as a database for PHP) we simply go to the applicatin panel and click the + sign as shown in the picture below

And then MySql Connection window opens up. Follow these easy steps now:



Connection name = conPHP (or whanever you like)
MySql Server = localhost (if you are using it on a local computer i.e your own computer)Username = root (Thi is the default user name. You can even enter the one you've defined)password = (I've not specified any password so I'm gonna leave it blank)
Database = DbName (You can either type it or select one by clicking on the select button)
After entering all the details hit the Test button. If everything goes fine you'll see this dialog show below:

Congrats! you've just setup the the database connection without writing any codes yourself. Now just switch over to the code window and see that code Dreamweaver 8 has generator for you. Ewww lots of code isn't.
Isn't Dreamweaver 8 Great?!!
Thanks for viewing!
Let me now if you it was helpful to you
Thanks agian !!

Monday, 2 April 2007

Learning Dreamweaver 8

Ahem...so you wanna learn Dreamweaver 8 eh?
I would recommend you to go and and read the book titled: 'Sams Sams Teach Yourself Macromedia Dreamweaver 8 in 24 Hours' as it will really get you started from day 1 or rather hour 1
:-)

Please let me know if you find this info helpful.
Thanks and cheers!

Code writing Tips on Dreamweaver 8



Alright now, I hope that you are up and running with your dreamweaver 8 and I just thought of sharing some tips with you regarding Code writing and setting some preferences for it. The picture below shows some codes collapsed.



The best thing that I find in it is the ease of use and conveniency to work with the code. For example if you have 300 lines of code and want to work with only certain section or part of your code at line number 275 and at the same time you wanna refer something at line number 10 it would be very inconvenient to got from line # 275 all the way back to line # 10 but wait, what you can do is simply select want you don't need or require and collapse the code. Ok I hope that was quite easy to do :-)

Do you know that if you want to copy or select certain tags in HTML, now you don't have look for the opening and closing tags to select it and copy it. With Dreamweaver it is done with a click of a button as shown in the picture below:

Just click on this button it will look for the ending and closing tags for you. and you can copy it or delete it or whatever you want.

You can even change the coloring scheme of your coding window.
Just goto Edit menu and click Preferences or simply hit Ctrl+U shortcut key to bring the preference window. You can change the way the code appears the lots of things in there.

Hope you find some of my tips useful!

^_^

Take care!