简体   繁体   English

使用哪种语言-简单形式+ MySQL +管理页面

[英]What language to use - simple form + MySQL + admin page

Apologies if this is not the right place to ask but here goes... 抱歉,如果这不是一个合适的地方,但是这里...

What should I use to create a simple web application for our website? 我应该使用什么来为我们的网站创建一个简单的Web应用程序?

I'm the IT guy for a small non-profit. 我是一家小型非营利组织的IT人员。 On our website we have a page with a large form in which users can fill out information on an application form. 在我们的网站上,我们有一个大表格页面,用户可以在其中填写申请表上的信息。 The information gets sent to a MySQL db. 该信息将发送到MySQL数据库。 This data can then be accessed and edited by a couple of members of staff behind a logged-in part of the website. 然后,网站登录部分后面的几个工作人员可以访问和编辑此数据。 There's only two dbs being used: the main one with all the data and the one used for login details for the web app. 仅使用了两个数据库:主要数据库包含所有数据,另一个数据库用于Web应用程序的登录详细信息。 It's all done with PHP and functionally is fairly simple - just a form with lots of fields to collect data and a basic secure "manager" page to do a bit of stuff with that data. 这一切都是用PHP完成的,并且功能上相当简单-只是一种表单,其中包含许多用于收集数据的字段,并且具有一个基本的安全“管理器”页面来对该数据进行一些处理。

The problem is that we need to make changes to the app, and to extend its functionality quite a lot. 问题在于我们需要对应用程序进行更改,并对其功能进行大量扩展。 I have a little bit of experience playing around with PHP but I've taken one look at the code used and decided it'll take too long to decipher it and see what's happening where. 我有一点使用PHP的经验,但是我看了一下所使用的代码,并决定将其解码并查看在哪里发生的过程将花费很长时间。 The code is uncommented and a bit of a mess. 该代码没有注释,并且有些混乱。

I'm starting to think that rather than investing time to relearn what little I knew about PHP and untangle all the code, I might invest the time in learning another language and/or framework to get this done. 我开始认为,与其花时间去重新学习我对PHP的了解并解开所有代码,不如花时间去学习另一种语言和/或框架来完成这项工作。 I want the resulting web app to be a lot easier to maintain in future by me or anyone else who comes along and has to make a change. 我希望最终由我或其他需要做出更改的人来维护最终的Web应用程序。

Would you recommend using Django/Python for a project like this? 您是否建议将Django / Python用于此类项目? Zend/PHP? Zend / PHP? Just PHP and notepad? 只是PHP和记事本? I want the app to be done fairly quickly so the less steep the learning curve the better. 我希望该应用程序能尽快完成,因此学习曲线越陡峭越好。 Many thanks for you time. 非常感谢您的宝贵时间。

Another good PHP framework is CodeIgniter . 另一个好的PHP框架是CodeIgniter

They also have a good webcast that outlines how to begin with the framework as well as create a simple blog [ tutorial ]. 他们也有一个很好的网络广播,概述了如何从框架开始以及如何创建一个简单的博客[ 教程 ]。

I would recommend a PHP framework, such as CakePHP . 我会推荐一个PHP框架,例如CakePHP Spend 20 minutes of your time and follow their blog tutorial . 花20分钟的时间并遵循他们的博客教程

Using PHP alone can be tricky, especially when you will have to deal with security issues. 单独使用PHP可能很棘手,尤其是当您必须处理安全性问题时。

From what I can see you have asked 2 questions. 据我所知,您问了两个问题。 1. Should you maintain and extend the current code base or do a rewrite? 1.您应该维护和扩展当前代码库还是进行重写?

Rewrites always take longer than you think. 重写总是花费比您想象的更长的时间。 And even if you do the rewrite to avoid learning the codebase you would still need to learn the current codebase to ensure you capture the current functionality before adding any new features in the rewritten codebase. 即使您进行重写以避免学习代码库,您仍然需要学习当前代码库,以确保您在捕获新功能之前在重写的代码库中添加任何新功能。 I would keep the current codebase and maybe do some refactoring as you add features. 我将保留当前的代码库,并在添加功能时进行一些重构。

  1. What should language and frameworks should you use? 您应该使用什么语言和框架?

I would stick with PHP, CakePHP is a solid framework and so is Zend. 我会坚持使用PHP,CakePHP是一个可靠的框架,而Zend也是如此。 I would read up on both and do a couple of tutorials and make your decision. 我会仔细阅读这两本书,并做一些教程,然后做出您的决定。

As Anax states, I'd suggest that you look to use PHP. 正如Anax所言,我建议您考虑使用PHP。 If code is already implemented then you have a start. 如果代码已经实现,则可以开始。

PHP isn't hard to re/learn. PHP不难重新学习。 I know some don't like it, others like it but simple fact, either way it isn't hard to learn. 我知道有些人不喜欢它,有些人喜欢它,但事实很简单,无论哪种方式,它都不难学习。 But, more importantly consider the following: 但是,更重要的是考虑以下几点:

You obviously have access to the hardware stack required to use PHP and MySQL. 您显然可以访问使用PHP和MySQL所需的硬件堆栈。 Introducing a new language/technology may cause unforeseen issues with getting a production site set up. 引入新的语言/技术可能会导致无法设置生产站点。

Now this doesn't mean that you can't write certain components in other languages. 现在,这并不意味着您不能用其他语言编写某些组件。 You could, if you were so inclined. 如果您愿意,可以。 But you probably shouldn't be so fast to get rid of PHP just to learn another language. 但你可能不应该这么快摆脱PHP的只是学习另一种语言。 Do you have important (technical) compelling reasons to use something other than PHP? 您是否有重要的(技术上的)令人信服的理由使用PHP以外的东西?

If you are mostly concerned about the spaghetti code in place, you can get that anywhere -- even new development. 如果您最关心的是通心粉代码,则可以随处获取-即使是新开发的代码。 Better to re-factor the code and fix and add to what you have than start from scratch. 最好从头开始重构代码,然后修复并添加到现有内容中。

I can offer some general considerations: 我可以提供一些一般性考虑:

  • Whatever language you choose, get a good IDE for it. 无论选择哪种语言,都可以获得一个不错的IDE。 Having automatic syntax validation and code completion helps a lot if you're a beginner. 如果您是初学者,具有自动语法验证和代码完成功能将大有帮助。 Don't use plain text editors. 不要使用纯文本编辑器。
  • Teaching yourself how to code well will make for a very frustrating experience unless you have a lot of patience. 除非您有足够的耐心,否则自学如何编写良好的代码将使您感到非常沮丧。 This generally comes from being really sure that you want to do it. 通常,这是由于确实确定要执行此操作。
  • Be very conservative in your time estimates. 在您的时间估算上要非常保守。 Having many setbacks is guaranteed if you're a beginner. 如果您是初学者,可以保证有很多挫折。
  • Start out by focusing on reading about writing code, not focusing on writing code. 首先从专注于阅读有关编写代码的知识开始,而不是专注于编写代码。 If you're learning Python, read the official tutorial first. 如果您正在学习Python,请先阅读官方教程。 The same goes for PHP. PHP也是如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM