How To Create User Accounts for Website on LAMP Server? - mysql

I am working on a Linux, Apache2, MySQL and PHP server setup currently. I have a dynamic website up and running. I want to create a register / sign-in portal. How would I go about creating a user authentication using PHP and MySQL? I can't find anything on Stack Overflow, and I've searched over google but I'm only finding outdated information.

Related

Why I cannot "insert into" but can "update" mysql table?

I moved a website from a classic shared hosting server to an AWS server where the LAMP environment is run inside a docker container onto which I map the website pages and DB.
The website is correctly populated with the content provided by the DB, I can correctly update an article from the admin area of the website but I can only add a new row via INSERT INTO statement through phpmyadmin console but no longer from the admin area of the website. Everything worked fine before so my guess is that something is preventing my code from inserting a new row in the tables of the database whereas it allows an update.
Anyone ever experienced a similar problem and knows what shall I look for?
I am using Matt Rayner lamp:latest-1604 container with Ubuntu 16.04.1, Apache/2-4-18, PHP version 5.6.33 and MySQL 5.0.11
About the AWS instance, it is a t2.micro, cofigured using the tutorials provided by Amazon Web Services Documentation.
Thanks

WordPress Access

I'm working on a website with a friend using Wordpress and we are trying to access the same WordPress account from both mine and his computer, so that we can work on the website together. We have tried to add each other as admins but can only access the new account from the computer the admin has been created on. Does anyone know how to do this?
By the way wordpress is run on wampserver
WAMP server is for local development (like XAMP, LAMPP and MAMP). When you install WAMP and install Wordpress inside it, it can be only accessed from that computer. You can create multiple admin accounts on single Wordpress installation. (Do not use single admin account for both of you.)
However in this case, you can't access the local Wordpress installation with multiple computers. to do that you may have need to buy a domain and a hosting from a hosting provider. Then you can create two admin accounts and start developing.
Or, as JJJ suggested you can convert WAMP+Wordpress installed computer to a server, but its hard and I do not think it'll be a good idea for this.
WAMP is local. You can move the WordPress install onto a shared hosting relatively painlessly and cheaply then can collaboratively work on it.

saving users in custom table in openfire xmpp

I have installed openfire on windows machine and pointing to our mysql database.I have created test users in openfire and testing with xmpp client on my machine . Everything is working fine.
I have opened our mysql database and seen so many tables are created from openfire where tablename starts with of like for example ofuser which stores user registration information.
Now instead of storing user registration information in ofuser ,I want to store user registration information in my custom table like for example chat_registrations.
Is it possible in openfire, if so how to do it?
You can do it but for this you have to modify openfire from source and build the system for yourself. To do this fork openfire from github, clone your repository in pc, open source code with you favourite IDE, then modify openfire's sql queries related to ofUser table. You will get them in src/database/openfire*.sql . Build the modified system and install it to server.

How to access server MySQL database from iOS app

I'm trying to write an iOS app using Xcode.
A simple login prompting username and password.
I have no idea how to open a database connection to validate the username and password.
The database I use is mysql.
I tried using this link http://macbug.org/macosxsample/mysql#.Ur8AYBbtGPF
but I get an error when I tried to add libmysqlclient.a to the frameworks and library.
If your database is on a server somewhere, then you would generally not have your iOS app interact directly with the database server, but rather you would write a web service that the app would interact with (via NSURLConnection, NSURLSession or something like AFNetworking), and the web service would interact with the MySQL database.
In terms of how to write a web service, often, when people are writing their first web service, they'll use some simple technology like PHP. Do you know what options you have on your server? If PHP is an option, then you can check out Ray Wenderlich's How to Write a Simple PHP/MySQL Web Service. Then check out How to Write an iOS App that Uses a Web Service.
You should use SQLite instead of MySQL for iOS application. You are referring MacOSX application tutorial. try this http://www.raywenderlich.com/913/sqlite-tutorial-for-ios-making-our-app

How to access phpMyAdmin on remote server

For my websites I use Dreamhost. Dreamhost requires you to create a hostname (ex: mysql.mclindigital.com) that the database will reside on. For me it's simple, if I want to access phpMyAdmin, I simply navigate to mysql.mclindigital.com, and it enters into phpMyAdmin automatically.
Apparently Dreamhost is in the minority using this method, because most people seem to use "localhost". So, how do I access phpMyAdmin for these websites? Will I need to get their Web Panel login info to browse around for this info?
As an example, I had a past client and I had to go here: http://216.120.237.104:2082/3rdparty/phpMyAdmin/index.php to get into their phpMyAdmin. I never really understood what I was doing, but it just worked. Now I am in the same situation, but this time the client isn't as tech-savvy and is unable to give me the URL I need to go to.
Also, I should point out I am not 100% certain that they have phpMyAdmin installed. I do know they have a database however, because they are running a Wordpress Blog.
There is nothing magic or special about phpMyAdmin. It is just
a bunch of php scripts.
Some webhosts(Such as dreamhost) may install it as standard
similary to formmail and a bunch of other tools they may install.
Your problem is most likely that you client don't have
phpMyAdmin installed, and the easy solution(If you have ftp access)
is to go to http://www.phpmyadmin.net/home_page/index.php download
phpMyAdmin, configure it and then just upload it to their ftp server
your self. Then you can acces it similary to any other php script.