Do you have some questions about web development (PHP and MySQL)

I did a bit of web programming (using PHP and MySQL), but not too large in scale. I was thinking about how someone would create a type of social network, and I ran into some problems.

  • How would you safely and securely store passwords in MySQL? What types of encryption would you use?
  • If users are allowed to upload photos, would it be better to save them in a database or upload them directly to the server?
  • What open source web applications (such as WordPress) would you recommend reading and learning (preferably something simple but well written)?

Everything that was taught in the classroom or written in books does not seem to translate very well into real production code. They just seem like very basic examples.

Thank!

+5
source share
7 answers

For password storage, use one-way salt hash for security. Here is an article on why .

+3
source
  • Store the salty hash. I would personally step away from md5 and instead use something like sha. sha1 + salt will be held for some time =]

  • If you store images as blocks in db, you will probably have an easier time in the future supporting them (along w / db, fetching, etc.). But in fact, they will be damn fast in the file system, but I would prefer them in the database, since I have a lot of code that interacts with db, and I am comfortable working in this area. It is for you.

  • , WordPress ... . , . , .

- Zend Framework CakePHP. , , , Zend, . CakePHP PHP.

, , , , SQL-, xss, , , ..

.

+2

, script, , . URL URL-, .

, ? mysql , PHP script , , .


, , .


, , Wordpress . . , .

+1
  • - (, sha1 md5). "", 5 md5 ( "social" ) - . , , , / .
  • -, . ( 1000 ), ( , ). , (, , , ..). . ,

    {bin}/{userId}_{pictureId}_{token}_{variant}.{fileExt}

  • -, PHP, PDO.

+1

, MD5 . MD5 , . : MD5,

, , . , - roothell.

0

3: Rails ( Symfony), Wordpress Gallery. , , -, .

, 2 . .

1: , . Mysql password(), , .

0

.

MySQL? ?

. https://stackoverflow.com/search?q=password+hash+database+php

, ?

. https://stackoverflow.com/search?q=store+images+database+php

- ( WordPress) ( - , )?

. https://stackoverflow.com/search?q=social+network+php

It should also be borne in mind that launching and managing a social network site is not just encoding it. Are you sure you want to build it from scratch? Think about whether you will be equally pleased with something like Ning, where everyone can start their own community without any programming?

0
source

All Articles