Creating a Comments section - Best approach? [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to create a comments section for pages on my website, and was wondering what is the best approach to adding one?
I don't want to use Wordpress because I think it is unnecessary for just implementing a comments section. The rest of my site is very basic. But please correct me if I'm wrong.
I can do it using PHP and MySQL. Is there an already documented best design for the DB schema used for comments?
Or I can use the facebook plugin. However I would also like to allow users to log in through their google accounts. Don't think the FB plugin supports that.
So what is the best way to do this, while allowing users to login (to post comments) using their FB or google login?

The "best way" is often depending on very personal requirements, which you did not specify. If you want to practice programming, or play with some server-side programming, maybe do a little "dynamic HTML", then you want to do your own thing with PHP and MySQL, or another technology that you want to learn and can deploy for your website (though PHP+MySQL is the most common stack you can deploy to).
If you are going that route, then I suggest looking at PHP frameworks that offer an ORM. I personally like Kohana, but FuelPHP looks like a good candidate as well and and it's a bit more modern. Take a look at the ORM examples in the links - they offer hints on how to design the model, which is basically how the database schema will look. If you're not familiar with ORM, you might want to review the Wikipedia article on ORM.
To get people to log in with Google authentication, you'd need to learn about federated authentication and its various protocols. Google uses OpenID Connect (which is an OAuth 2 extension), while Facebook like to use their own protocol (Facebook Login) but can also support the standard OAuth 2. There are several libraries that will help you implement these protocols, though I like to use "The League"'s packages. You might want to learn about PHP composer by the way.
If you're not into writing code that you'd then need to deploy and maintain, and would prefer to get all the bells and whistles out of the box with minimal effort, you might want to look at Disqus.

Related

Making a website (with a database) in html/css/php OR Wordpress? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Heyy, I'm wondering what would be ideal for creating a website like : http://either.io, I'm not sure if i should make the website from scratch using html/css/php/js etc or use something like Wordpress. Im competent in html/css/php/js however Im not sure if it'll be a waste of time to do it this way as it seems obsolete. The website will have a database, and i also want users to be able to make accounts and submit content to the website, will Wordpress be able to do these functions and if so, will it be easy to manage the database? Also if there is anything else to use, I would love to hear. So for the general question :/ I really didn't know where else to ask! Thanks in advance.
EDIT:
Also i was look at ruby on rails, would that also be a valid option? Thanks
Definitely you should use any CMS (such as Wordpress) for an simple project because there are quite a lot of solutions, components and community support.
Go to custom php(or any other language) project when CMS can't fully cover your planned functionality
For what you describe the website you need to create is simple enough, so Wordpress should make all the job you need. You don't need to build the wheel again.
I recommend you to start by reading Wordpress.org to check the documentation, what you can do with it and how it flow works.
But basically it provides you user authentication and content management, so you should be all set.
If you are creating a static site not carrying much data, html css is better. But if you need to store lots of user information it is better to go with wordpress. Any kind of powerful website can be created using wordpress provided having knowledge in php.
Notable websites using wordpress:
1.IBM Jobs
2.Newyork times
3.Forbes

PHP,mysql,ecommerce website development [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
M new to ecommerce website development. I just want to get the idea about how to start making ecommerce website with custom php using oop. Can anyone guide me about what are the security featues i have to add? Thanx in advance :-)
Probably the best place to start would be to follow one of the many books out there which teach OOP PHP and related technologies/languages whist building an ecommerce system from scratch.
These books usually go through all aspects of the system including security etc and will give you a good starting point and understanding of the ecommerce system you create. There will most likely be some aspects that are not covered in detail but the books will usually give a good outline or point you in the direction to find out more information.
From there research online or through further reading the latest techniques related to security etc that you can then implement into your system.
I must admit, as ceejayoz suggested this is not really a newbie thing to start off with, especially if you intend to make it a full production system (release to the public)
I used similar books when I was first starting out with PHP but used them only to gain an understanding of OOP techniques, PHP syntax and best practices.
The one I followed was for a CMS System, I did not use this system outside my own development environment, only to learn and understand. From there I began using an off the shelf product, but had the skills and understanding to modify the system as I desired.
ecommerce systems can be incredibly complex, especially if you are a newbie to PHP or even programming. If you are looking at an ecommerce site for your business then use an off the shelf product. If you are a developer looking to branch out onto the web and would like to sell off your own ecommerce system then it would still probably be a whole lot better to grab and customise an existing open source system (no need to re invent the wheel)
Don't do this. If you're asking questions about "security features", you are not in a position to build a secure e-commerce site.
It's much better to take an off the shelf site and customize it to suit your needs. 90-95% of the functionality will be already implemented, so you can focus on making the 5-10% that really differentiates your site as best as it can be.
Once you've worked with several e-commerce packages and are familiar with their source code and database structures, you might be ready to build your own.

What types of websites should I choose to build using Ruby on Rails over 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 9 years ago.
Improve this question
I have read many advantages of Ruby on Rails over PHP with a platform. However, it seems like Ruby on Rails is limited compared to PHP with a platform. Is there any special types of websites, such as blog, portfolio, ecommerce, job-search, content management website and etc., where I should choose Ruby on Rails over php with a platform?
For example, I've been meaning to build a ecommerce website with multi-vendors. However, many people recommended using PHP. Also, when I looked through the popular website examples using RoR, majority of website seemed like company websites with limited contents, portfolios, or websites with video links.
Rails is an MVC framework, PHP is a language. You might look into "Cake" for a proper comparison.
Rails will do anything you want it to do*. A lot of this comes from the rubygem ecosystem, most of which are usable without rails.
Out-of-the-box, with no other alterations, Rails provides really convenient places to describe your data (the models), figure out what data should be used to respond to requests (the controllers), and how to show that data as an HTML web page (the views).
*Except be faster than micro frameworks (sinatra, flask, ~ node)
I would not use rails to build something the size of Twitter or Facebook. I would definitely use Rails to build the first versions of Twitter and Facebook that hit the web.
I frequently refer to Rails as "a website in a can". As such, it is excellent for every example on your list, although it'd likely be overkill for a portfolio because you don't need the database.
Finally, if your problem is in any way a common one? If you are seeking to build a "normal" sort of website? If you think other people have solved the same problems you are trying to solve? Rails (plus gems) will do it for you, and keep you happy* while you do it.
I have an interview question: Build me a website with users who have avatar pictures. One guy literally did it one line of bash prompt, via the rails-composer tool.
Remember - There are basically two principles in RoR. One, from Ruby - "Maximize Developer Happiness", and one, from Rails - "Convention over Configuration". AKA, you will enjoy yourself, and frequently have to do nothing.

Benefits of using cakePHP? [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 7 years ago.
Improve this question
I know PHP well. But i haven't tried cakePHP before and i was willing to learn cakePHP. So just want to know that is there any benefits of using cakePHP over PHP?
Thanks,
aby
cakePHP, like CodeIgniter, FuelPHP and Symfony (just to name a few) are frameworks. What this means is that they have tried to abstract some of the normal, every-day things you do in development in an effort to speed up development time and make you more profitable.
In today's world, there is no excuse for not using a framework. If you refuse to use a framework, you find yourself creating a lot of the things that a good framework provides anyway (i.e. data abstraction layers, session classes, form validation, etc). By using a framework, you not only gain time, but you gain stability as the different components of the framework should be designed to work well together and have been thoroughly tested by the community.
Whichever framework you choose is up to you and hopefully now you understand it's benefits.
CakePHP is an MVC framework that will allow you to setup your data model and connect it to a database to be easily manipulated in PHP. It also allows you separate your business logic from your display logic using a controller.
It also gives you a lot of useful functionality like authorization, sessions, form validation, pagination.. for free. You should check out the feature list.
If you didn't use CakePHP you would have to roll your own framework, which is a lot of extra hassle and work. There are of course other frameworks.
The answer is pretty simple, it comes down to your need's, do you need a framework?
You say that you know php well, i doubt you know it as well as you think as you would not ask a question of this nature, you would understand the concepts behind a framework.
You say:
So just want to know that is there any benefits of using cakePHP over PHP?
it's not a language sir, it's a framework that supplies the PHP foundations for an application, why would you not wan't to use such a thing, what you should be asking is:
What's the best framework to learn once you have mastered PHP Fundamentals.
But don't ask it here, there are plenty of posts that answer that question for you.
CakePHP is an MVC framework But to simply say you need to design the data models and relationship (creating necessary tables) before start the work , once you use bake command 70% of coding are given

Create an seo and web accessibility analyzer [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm thinking of making a little web tool for analyzing the search engine optimization and web accessiblity of a whole website.
First of all, this is just a private tool for now. Crawling a whole website takes up alot of resources and time. I've found out that wget is the best option for downloading the markup for a whole site.
I plan on using PHP/MySQL (maybe even CodeIgniter), but I'm not quite sure if that's the right way to do it. There's always someone who recommends Python, Ruby or Perl. I only know PHP and a little bit Rails.
I've also found a great HTML DOM parser class in PHP on SourceForge.
But, the thing is, I need some feedback on what I should and should not do. Everything from how I should make the crawl process to what I should be checking for in regards to SEO and WCAG.
So, what comes to your mind when you hear this?
Rather than 2 great tools out there,as RPM1984 said, there are literally hundreds of such tools which do stuff like checking alt, title, keywords and description and so on.
Since the tool you want to build is for personal use, I advise you look around several sites like seobook,seodoz. There are lot of such tools which provide various functions and most of them I am sure are free. Building a tool that is available out there free of charge is resembling to invest on wheel. Do not do that unless you are learning something.
Just For Your Information, usually there are several elements that I can check without pay money and easily:
MATA Property. Title, Keywords(this is something important), Description.
Semantic Structure. h tag, alt tag and so forth.
Link. Inbound links, their domain names, outbound links and things like that.
Presence On Significant sites like demoz.com as well as blog, twitter, facebook.
Domain Name of Your Site. Things like its register time is considered important.
If you want to know those info, then there are lot of free tools you can turn to.
Hope this helps and good luck.

Categories