Shop OBEX P1 Docs P2 Docs Learn Events
Website programming advice — Parallax Forums

Website programming advice

Don MDon M Posts: 1,653
edited 2011-05-11 06:36 in General Discussion
I want to be able to upload data to / download data from a webpage of my own. I have a device that I made (uses a prop :) ) that is connected to a smartphone and I want to "push" data from my device through the smartphone through the web to my webpage and also receive data from my webpage through the smartphone.

What I need to understand is what is needed to allow data to be uploaded to a webpage. You can think of it as some simple fields being sent for example- name;number1;number2. Would only be a few fields. I want to understand and learn how to do this and program my own webpage so I am interested in what programming language should be used to create the webpage? I have the domain name and a static site page already. Is there a certain type of server that should be used (requested)?

I am pretty green at this as you can tell but hopefully this discussion will evolve into something more understandable.
I just need some direction here so I know where to look for information & books etc.

Thanks.
Don

Comments

  • bill190bill190 Posts: 769
    edited 2011-05-09 14:14
    I've not done this for 10 years, so what I say might have been replaced with something newer and better?

    Anyway web sites were run on the UNIX operating system and a MySQL database was used and Perl programming language "cgi" scripts were used on web pages. Then a Microsoft Access database could be used as a "front end" to that MySQL web server database via ODBC.

    The following folks do this kind of stuff and would be able to tell you what the latest thing(s) are...
    http://www.pair.com
  • Don MDon M Posts: 1,653
    edited 2011-05-09 14:51
    My site is hosted on Godaddy.com
  • FranklinFranklin Posts: 4,747
    edited 2011-05-09 15:07
    You could ask Godaddy support on how to do this. It usually depends on the hosting company as to how they allow access to your site.
  • Don MDon M Posts: 1,653
    edited 2011-05-09 15:21
    Ok. So I just got off the phone with GoDaddy. My choice in hosting this is with either a Linux server or Windows server. As they mentioned it would depend on what I write the code in for the website as to which server I would need. Any suggestions here regarding that? Pros/cons of Linux vs Windows server? She mentioned that with the Linux server I could write the code using PHP and MySQL for the database. For the Windows it would be in ASP.NET and either MSSQL or MS Access.

    I am not committed to any language at this point so looking for further guidance.
  • ZootZoot Posts: 2,227
    edited 2011-05-09 15:23
    PHP and mySQL
  • Jorge PJorge P Posts: 385
    edited 2011-05-09 16:19
    I agree Zoot. PHP and MySQL.

    Even if you decide afterwords to go to an IIS server, you can still use PHP and MySQL through an addon. I did this in Windows 7 by enabling a few featurs that are disabled by default, although it was a beta before it went public. It should even be possible in the Home Versions, provided you have the install disks. Great for testing.
  • Don MDon M Posts: 1,653
    edited 2011-05-09 16:26
    What about Ruby on Rails? What can anyone tell me about it?
  • SSteveSSteve Posts: 808
    edited 2011-05-09 16:49
    Ruby on Rails is powerful and flexible, but has a serious learning curve. It's an extensive framework that makes lots of common tasks easy, but you still have to figure out how it implements those common tasks. You also need to learn Ruby, but I think once you get used to its design it's a fantastic language.

    I have no idea how GoDaddy's Ruby on Rails implementation is. I have an account with http://hostingrails.com for $120 prepaid annually. It's going on four years now and they've been fine as a webhost. I just looked at their site and it looks like they have some kind of promotion where you get a year of free service. I haven't read the fine print, though, so caveat emptor.

    I never set up a big Rails installation on my site, just some experimentation. I just looked at a test site I haven't looked at in over two years and it still works.

    If you want to learn Rails, the definitive book IMHO is http://pragprog.com/titles/rails4/agile-web-development-with-rails. Be sure to get the fourth edition because it covers the newest version of Rails.
  • Don MDon M Posts: 1,653
    edited 2011-05-09 17:06
    The hosting pricing was fairly decent I felt- $188 total for 3 years (includes 25% discount promo) and includes SSL certificate with fixed IP address, unlimited space and 10 email credits.
  • Don MDon M Posts: 1,653
    edited 2011-05-09 18:37
    They confirmed Ruby on Rails would work fine with their hosting.
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-05-09 18:45
    Apache/MySQL/PHP - AMP - you can carry it from Linux to Windows. I have it running on both platforms at home.

    Can you tell us more about the connection from your Prop device to your smartphone? IP? Bluetooth? Serial?

    Keep us posted on your project!

    Thanks!

    Rick
  • SSteveSSteve Posts: 808
    edited 2011-05-09 18:55
    If you aren't going with Rails, I'd also strongly suggest MySQL/PHP. You don't want to get tied down to Microsoft's proprietary systems.
  • Don MDon M Posts: 1,653
    edited 2011-05-09 19:04
    Thanks everyone for all the suggestions.

    @Rick- Bluetooth.
  • bill190bill190 Posts: 769
    edited 2011-05-10 10:23
    FYI - Each one of the things above is a lot of learning / book reading. Installing and configuring a MySQL database is a college degree in itself, but hopefully they do that for you. Then you just "use" the database.

    But there is quite a lot to that as well. MySQL is a relational database and you talk to it with "queries" which are worded like this...
    SELECT firstname, lastname, address, age FROM friends WHERE firstname='%s' AND lastname='%s'

    And THAT can be a lot of learning on its own... However you can "cheat" with that wording. If you use Microsoft Access as a "front end" to MySQL via ODBC, you can use it to create tables, queries, etc. And it is a LOT easier to do this using Access.

    You can use the visual part of access with drop down boxes, etc. to create a query, then click on SQL View and there is the SQL wording for you! It would just need a little modification to use in a script, but the basic wording is there.

    Also there is free software called "Open Office". I think that has a database as well. I don't know if that has all the same features as Access or not?

    Anyway that could save you some time having to learn the SQL language...
  • ZootZoot Posts: 2,227
    edited 2011-05-10 10:49
    don M -- if you don't need to store data collected "on the site server" for any length of time (say, after the user/visitor has closed their browser) then you do not need mySQL per se. PHP is a pretty easy scripting language designed to output text (and images) to a browser. It lets you easily collect "form variables" -- essentially info passed to the server script via form on a web page, or via query to a server page like

    somedomain.com/script.php?command=forward&speed=100

    In the page (script) itself it is not hard to parse out the variables for "command" which would = "forward" and "speed" which would = 100.

    The question is what are you doing with the information collected? You could for example, simply have the page resend the data on to another 'net enabled device (like a Spinneret), or you could "store" the data, etc. MySQL is one way to store data (and it is NOT as hard as bill190 makes it out to be, and your hosting company will have all that set up and ready to go; but there is a bit of learning curve). If the data is saved then another script might "read" the data when your phone sends the query to the site.

    If you are storing trival amounts of data, then you could sidestep the whole database issue and just write the data to a simple text file -- that file could be "read" by one script and "written" by another. See "fopen" and "fwrite" in the PHP documentation.

    The only real caveat for all of it -- make sure to preprocess any variable values submitted to the page/script -- this is where nasty folks with evil agendas will try to exploit vulnerabilities to upload their own code (generally so they can not deface your site, but rather, use your hosting account for disseminating malware and sending spam). Again, the PHP documentation (http://php.net) has a really good, brief section on security during form submissions that has simple examples for basic protections.
  • Don MDon M Posts: 1,653
    edited 2011-05-10 18:09
    This whole project at the moment is really just a proof of concept. I would need to have "some data" stored on the website to retrieve to the smartphone app and then be able to add more data from the prop enabled device through the smartphone to the website to view. So in essence- yes it would need to be stored.

    I am wondering if there are any Google apps that may already accommodate this type of application.... ?
  • Mike GMike G Posts: 2,702
    edited 2011-05-10 21:40
    Don M, it sounds like you wan to submit data and retrieve data. I'm sure it will get more complicated as time goes on. What about just grabbing the Micosoft's Web Express ? It's free and comes with a database.

    As a matter of fact, you can download PHP/Apache/MySQL too.

    There's really no reason to rent host space until you're ready to deploy. Especially, since this is a proof of concept. What kind of computer and operating system do you have?
    I am wondering if there are any Google apps that may already accommodate this type of application.... ?
    I'm not sure. You'd need to flush out your app a little more.
  • Don MDon M Posts: 1,653
    edited 2011-05-11 05:37
    Mike- I have Windows XP PC and a Mac.
  • Mike GMike G Posts: 2,702
    edited 2011-05-11 06:36
    Going the .NET route will be a little easier. Microsoft bundles their development tools under Visual Studio. So you build your database, web pages, and configure the web server all from the Visual Studio. You can have a Hello World page running a few minutes after installing the Visual Studio Express. Going PHP/MySQL/Apache, you'll need to install and configure the software then find and install editors.

    Download Visual Studio Express and play around. You can always uninstall later.
Sign In or Register to comment.