c*******u 发帖数: 1269 | 1 I like to add a small polling application on my site, any easy way to implement
it? Below is my site, it is fair immature at this point, does not have any
dynamic generated content or fancy stuff. Also I like to learn how to
connect to a database in the backend to store polling result. Thanks.
http://www.communitynetworksolution.com/index.htm | c*******u 发帖数: 1269 | 2 Added one, has not linked to the database yet, in php file, I need to give
database user name and password? Is that safe? Sorry to ask such beginner
question. | t*******d 发帖数: 1530 | 3 no need username password. no one will bother to take the poll if they have
to
go thru registration hassle.
using IP address and cookie should be sufficient for ur purpose.
【在 c*******u 的大作中提到】 : Added one, has not linked to the database yet, in php file, I need to give : database user name and password? Is that safe? Sorry to ask such beginner : question.
| c*******u 发帖数: 1269 | 4 no, i mean to save polling result to database, i need write database login
and password information in php file? | s*******h 发帖数: 2148 | 5 yes.
usually use a separate file.
【在 c*******u 的大作中提到】 : no, i mean to save polling result to database, i need write database login : and password information in php file?
| c*******u 发帖数: 1269 | 6 I get the polling function working, but I have not got my
answer yet, is that safe to write username and passord in php file? | o***s 发帖数: 31 | 7 Yes, as long as this php file can not be accessed directly via url. This
file should always be included by a master file, a better solution is to
have all url accessible files in "public" directory while putting all
includes in another folder, say "lib"(and lib is not subfolder of public),
for instance. | c*******u 发帖数: 1269 | |
|