How to organize PHP and HTML code to make an e-commerce? [closed]

-2

I'm doing an e-commerce and finished planning the site. The site will have to be registered before buying the products, which will be done using PayPal.

My question is: do I login pages and no HTML login and then I put PHP, or do I do PHP and put HTML inside PHP?

    
asked by anonymous 16.10.2015 / 20:36

2 answers

2
In fact, the order of the factors will not change the final result of your project, but for better visualization and indentation of your code, rather than HTML in PHP when PHP prevails in the file in question and vice- versa.

    
16.10.2015 / 21:43
2

In terms of order, the only thing you have to keep in mind is the structure itself. Separate the PHP scripts from HTML , and so on.

You should also bear in mind that HTML scripts will only be responsible for static content, if you say that this is an online store, you do not have to force HTML and JS for PHP tasks, and likewise, there is no reason to force PHP to generate large amounts of code < in> HTML , since you can use it, and I recommend that you use files with the .php extension, even if they are only responsible for the login form, I think a few bytes will not make that much difference.

In any case you would not be properly organizing your code, you would be organizing the files. To organize the codes I recommend that you use classes or simply functions, because it is an online store, all security is tight , just remember this.

If you want, and you will definitely want to improve the structure, you must use ready-made structures, because besides being programmed by professionals, thousands of people have evaluated them, or if you prefer to go old, you will have to do it much more effort than choosing where to put the login form.

    
17.10.2015 / 06:55