LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-24-2009, 06:51 PM   #1
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
PHP/MySQL FOSS for managing user sessions on the web?


Hi. My co-worker and I are working on this robotics project where robots are controlled over the web. I don't want to go into all the details, but basically the users visit a page where they have access to a PHP-based interface that allows them to send commands to robots in our tech lab (via an intermediate server). Our web server is running Apache.

Anyway, now we need to implement session control, with user-names and passwords so that only certain people can have access to the interface at a certain time, with access to only certain robots, et cetera. We were hoping there was some kind of pre-fab FOSS solution for handling both the session control and maintaining the MySQL user/password database.

My co-worker knows a little PHP, and I know a little MySQL, but we are both noobs enough that we would prefer to do as little of this from scratch as is possible. We don't have a lot of time, and I know it is easy for inexperienced MySQL programmers to introduce security vulnerabilities.

If anybody could give us any tips to point us in the right direction, that would be great.
 
Old 04-25-2009, 01:18 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Yes, it's very do-able ... and probably a lot easier than you might think.

STRONG SUGGESTION:
Take "baby steps":
Quote:
1. Familiarize yourself with basic PHP
a) There are countless tutorials on the web
b) Book recommendation (lousy title; great material):
"Teach Yourself PHP, MySQL and Apache in 24 Hours", Julie C. Meloni

2. Once you've written and tried out a PHP "hello world" or two, then try out mySQL from PHP. It's easy!

3. Early on, try PHP "classes". Think about how you can use PHP classes in your web app.

4. Sessions basically come "for free" with PHP. Try it.

5. There are lots of ways to do authentication, but for your purposes, it's probably easiest to store your usernames and (pre-encrypted) passwords in mySQL. Again: Meloni's book will be a big help.

6. You've got lots of different choices for communicating between the Apache web server and your robot ... but maybe the easiest/most robust way is to simply use mySQL. The web app will receive and authenticate commands, and write them to mySQL. Some other, external app will poll MySQL and forward them to the robot.
Bottom line: you've got lots of choices. Better yet you've got lots of relatively *easy* tools that can give you a *clean* solution. Just K.I.S.S, take small, simple steps ... and have fun!

IMHO .. PSM

PS:
Just because somebody's created a pre-fabricated package that superficially *looks* like it might work, doesn't mean it necessarily *will*. Nor does it mean that a) getting up to speed with the package, b) testing it to make sure it'll do what you need, and (possibly) c) adapting it to make it do what you need won't be less effort than just doing it yourself.

The smart thing to do is to familiarize yourself enough with the basic tools (here, PHP and MySQL) well enough that you *can* build it yourself (if you need to), but can intelligently assess whether a prebuilt package really meets your needs (should you *choose* to use it).

IMHO

Last edited by paulsm4; 04-25-2009 at 03:40 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache php mysql and sessions helpme0904 Linux - Newbie 1 08-08-2005 03:24 PM
Dreamweaver, PHP, MySQL, and Apache Web server bentman78 Linux - Software 18 02-06-2005 05:09 AM
PHP and MySQL for web design - installing and further r3dhatter Programming 1 06-24-2004 02:10 AM
SQL mySQL PHP and Sessions poeta_boy Programming 15 11-26-2003 06:36 PM
Installing PHP and MySQL w/ Apache web server dcrealm47 Linux - Newbie 5 02-26-2003 11:21 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration