How can I implement server side code and a database on my site?
-
I have a totally static website, with a few html pages and a single css stylesheet. Whether it be Ruby/Rails, PHP, Python, whatever- How do I implement the code into my website? Do I just upload a .php or .rb to my file directory with the same name as the html page it will work on? Is the php/rb referenced in the html elements? What about the database (SQLite or MySQL?)? Is the database a file like the php/rb? Are there separate files for the database code, and the actual data file? So sorry for all the questions. I don't know why this information is so scattered all around the web. An overview of how to implement an interactive website would be a godsend.
-
Answer:
This information is âscattered all around the webâ and there is no overview because implementing a website that reads and and writes information to a database is not a trivial task. There are many variables involved that means thereâs no simple step-by-step tutorial that applies to all situations. Keep in mind that there is enough to know about web development that it canât adequately be coved by a college degree, and even then itâs an ever-evolving industry. Implementing an interactive website is a semesterâs worth of study, after a semester or two of computer science beforehand. Itâs not something that can be explained in a blog post or a forum answer. I suggest checking the website or forum of the developer of the script. They may have tutorial on how to implement it.
Ben Reimers at Quora Visit the source
Other answers
Before you embark on this it is very important that you have complete control over the server that you're using. I would also highly recommend testing the new site on another server before implementing it fully. I use PHP, which is probably the easiest but not the best language to use. To change all your files into PHP files, just make them .php instead of .html. PHP only executes code between the <?php ?> tags. it will output plain HTML to the user at the moment. If you wish to use PHP in your files, you simply use the php tags around PHP stuff, and it will execute it and insert the output where ever the php tags are in the html document. It is a very good idea to use MySQL or PostgreSQL. SQLite isn't as good at security, but is faster. The database files are stored separate to the document root on the server. You don't need to look at these files at all. Having something like PHPMyAdmin is useful to administer the database. If you want to experiment, I recommend using EasyPHP if you've got Windows. It come with copies of Apache (the server), PHP (for using PHP), MySQL (for database stuff) and PHPMyAdmin (for running the database). It is ready to go once you've downloaded it. http://www.php.net is a good site for looking up PHP problems, and you'll find something on the internet about SQL and MySQL.
Thomas Foster
I guess what's not clear is what u want to do with the server side code. And are you staying away from platforms like WordPress, Joomla, Drupal, etc. My journey to dynamic websites went like this: - static website, good but dated. - changed all files to php. used includes to get headers, sidebars, footer, etc. Added some dynamic content. - moved everything to WordPress. Dont worry about the code side of the site too much. Focus on the content and dynamic functions. Now I am extremely happy and have great dynamic content and functions. :) Aloha Arlen http://Hawaiiwp.com
Arlen Nagata
Related Q & A:
- How can I debug my php code?Best solution by Stack Overflow
- How can I implement an atomic incr and decr on top of an eventually consistent key-value store?Best solution by Stack Overflow
- How can I implement idle timeout in android?Best solution by Stack Overflow
- How can I implement a multilayer social network in R?Best solution by Computational Science
- How do I put an html code in a scroll box?Best solution by html.am
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.