Page 1 of 1
General Database question
Posted: Fri Jul 08, 2016 7:12 pm
by Pistris
Hi Guys
I was reading all i could about using a middleware to access the databases and i have a question
how exactly would you request the info from the middleware in a way that is secure
it seems to me that it would be the same case as connecting to the database directly
am not looking for code examples. My background is web development so i have never needed to use the middleware since our databases are
behind firewalls with rules that only let the sql servers talk to the servers where the web pages are hosted
thank you in advance.
Edd
Re: General Database question
Posted: Fri Jul 08, 2016 8:17 pm
by FourthWorld
Your web pages include SQL commands? No PHP on the server?
Re: General Database question
Posted: Fri Jul 08, 2016 8:29 pm
by Pistris
yes they include sql commands
the thing is that i check the session status on all the pages before actually executing the queries
that way i keep it secure
how the process would be done in live code.
am interested in making a complete middleware package so i dont need to write code over and over
on another note, i read everything you post, they are a good source of information
thanks for your quick response and all the time you spend helping the livecode community (am sure you get this all the time)
Edd.
Re: General Database question
Posted: Fri Jul 08, 2016 11:34 pm
by ghettocottage
Your web pages include SQL commands? No PHP on the server?
I think what Richard is getting at is that if you are using PHP, you are using middleware.
In the case of Livecode, there is Livecode server, which you can set up on your webserver and use it much like PHP. Or, if you are using Livecode to create an application that will not live on your server, then you can send your requests to some middleware on your server (such as PHP or Livecode Server) and that will output your data back to your application
There are different ways to encrypt and/or encode that data (to and from the server), so that your middleware will have keys or password or salt and can de-crypt/de-code your query, get your requested data, re-encrypt/re-encode it and send it back to you.
Here is one thread about this:
http://forums.livecode.com/viewtopic.php?t=23812
Is there a specific project you are working on, or are you just exploring ideas?
Re: General Database question
Posted: Sat Jul 09, 2016 2:57 am
by FourthWorld
Thank you for the kind words, Pistris. Now I have to see if I can live up to them.
PHP is the most common solution for middleware, and there are innumerable tutorials for using it with MySQL.
LiveCode Server can also be used in that role - these Lessons may help you get started:
http://lessons.livecode.com/m/4070
Bonus points: if you don't already have an SSL cert on your server, it's never been easier now that the Let's Encrypt project is here - completely free with automated renewals once it's set up:
https://letsencrypt.org/
Some shared hosts like Dreamhost provide support for Let's Encrypt, and hosts using CPanel will have support for it there next month.
If you're using a dedicated host or VPS running Ubuntu, the latest version (16.04) now provides Let's Encrypt through its package repository, so it can be installed via the normal package manager, apt-get.
Re: General Database question
Posted: Mon Jul 11, 2016 6:52 pm
by Pistris
Hi Richard
By reading my own post i think i answered my question
i guess what i need to know is how to communicate securely
how to post data to my web pages securely from within livecode (IOS)
Thanks
Re: General Database question
Posted: Mon Jul 11, 2016 7:25 pm
by FourthWorld
Use https instead of http. If your server is properly configured the rest just works.
Re: General Database question
Posted: Mon Jul 11, 2016 9:12 pm
by Pistris
ok so dumb question then
all i need to do change is
post myData to URL "
http://www.address.com/mypage.html"
for
post myData to URL "
https://www.address.com/mypage.html" ?
Re: General Database question
Posted: Wed Jul 13, 2016 3:37 am
by Pistris
Am I right?
Re: General Database question
Posted: Wed Jul 13, 2016 4:13 am
by FourthWorld
As long as the server is set up for HTTPS, yep, that should do it.
Re: General Database question
Posted: Wed Jul 13, 2016 4:47 am
by Pistris
Thank u
Am gonna try it tomorrow.
Re: General Database question
Posted: Wed Jul 13, 2016 10:06 pm
by Pistris
IS the hosting account that comes with the livecode account already setup with ssl certificates and ready to use HTTPS ?