Do you advise against using text files instead of database? [closed] - php

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
To make things short: I'm writing an anonymous forum software with PHP. I just feel like using a database is overkill and restrains my amateur skills. Do you advise against using text files instead of database?
Thanks.

A database has advantages like some sanitation (no breaking of delimiters, newlines etc.) and less danger of access conflicts when multiple instances try to read from the table - and different from a file-based approach, writing conflicts are constrained to the record in question only.
Recommendation: use database

To make things short: Yes. Strong advise against text files.

Related

I want to make an online recruitment website [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I want to make an online recruitment system(web) for my project in school. What are the language I need to learn except PHP. Thanks for the answer guys.
Not very proper question, you might find the answer by googling.
Anyway, You might need so far:
HTML: It will be like the skeleton of your page.
CSS: Basic knowledge would be a plus for understanding how to make it pretty.
MySQL: Unless you want a static page, you would need DB in order to save the data itself. Useful for manage cookies, sessions, users, etc.
My advice - Download some HTML free template and use it as base. Integrate it with PHP for DB connection and usage.

what is the diffrence between php api to connect mysql? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm currently using mysql_query() to approach DB.
I understand that this method will be removed in the future so I want to learn a new api.
What in your opinion is the best way and why? PDO or mysqli? or there is another one I haven't heard about?
Thank you.
I'm going to offer what I consider to be the best way to handle database stuff: Build your own class. In my case, this class just wraps mysql_* functions, however if I wanted to it would be really easy to change to a different one (such as if mysql_* gets removed). I only have to change a single file, and instantly the entire project is using a new API.
Believe me, do this right at the start and you will save yourself a LOT of work if and when you decide to change things around!

Require email registered to be from specific domain(s) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
All,
I'm curious what the best approach to this would be. In case the tags weren't noticed, I'm using PHP and Laravel 4.
My application requires that users register with an email address that is from specific domain names. Currently there is only one domain, however, I can see it being a requirement to white list others.
I would assume it would be best to put the domains into an array. Would I run a regex from $rules array against that array? I'm somewhat green to regex. I don't use it often enough to commit anything advanced to memory so feel free to talk to me like a 2 year old.
You can create a custom validator for this. See http://laravel.com/docs/validation#custom-validation-rules for reference.

How useful could be an html generator class? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm working on my first opensource project, and I found useful do do an html generator class, treating the html elements as php objects, but now I don't know if it really makes sense in the real world.
Have you ever needed an html generator class for you projects?
If your answer is yes, what would you find useful on it?
If someone wants to help in the project, you are welcome to the repository on github.Github repo
Thank you.
This approach, although liked by many at first sight, always fails a reality check.
Please learn about templates - the only way to go in dealing with HTML from PHP applications.
You need them only if you are some outsourced worker from India or China. Otherwise do not use them since you have potential to ruin your career and credibility.
Those tools are built for doing very dirty code without any future prospects.

Session handling in PHP [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
What is the best & most secure way you've handled sessions in a PHP application? I want to know the best, most robust and secure method there is. :)
Your session data will be pretty safe. If you want to make it even safer, encrypt it. Beyond that, you'll have to be more explicit about what you desire.
That would depend on your environment. If your using a shared host, it maybe possible for others customers hosted on the same box to access you session data. If that's the case, it might be safer to store it in a database. But every server is different. Can you elaborate on your setup, and what your trying to protect against?

Categories