Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I would like to set up user system in Wordpress, which is not limited to writing post or comment. Instead I would like to store custom user data (in my case users are tutors) for example the subject they teach and the price they charge. How could i do it with PHP or Sql?
You have two options here:
A) modify the registration form/process and request the users/tutors to input additional data when they register on the site; this will also require you to provide them with a user friendly interface screen where they can update/edit their information. What I usually do is create a view to display the user's info on the front end and then when loading that page check if the user is viewing their own profile and if so, load additional edit options in line with their data - I then use AJAX to allow them to update their own info.
B) if you want to manually manage this info yourself then simply have the users/tutors fill out a form and then you can update/edit a custom post-type called sevenine-tutor that you'll have to register/create in the system.
In theory you'd want these users managing their own profiles so option A) is probably the right route to pursue.
Questions like this are hard to answer because they're purely theoretical so there could be numerous ways to tackle them and whether an answer is correct or not is purely subjective. My advice would be to break your idea up into chunks and try tackling functions one by one and if you get stuck on something, then post relevant code here or to wordpress.stackexchange.com and get answers to very specific technical questions.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
When I created my pet site and visiting it. I noticed money systems and pet systems all need database for them. But I'm wondering is there any way to create new rows for money system? I need money system for that to purchase virtual pets and itens.
So is there any codes when i click on a thing in the site that adds or removes from database date? Thank you a lot!
I thought that follows that code before I know DB:
<?php
$coin=50;
?>
There are no 'magic buttons' working out of the box - you can get that kind of button but you need to create DB structure, connection, write proper functions/methods (depends on your coding approach) and then bind it to that button.
Even if you are going to use some package/plugin or whatever you find useful - you need to have configured DB to be able to use that.
It is even hard to send you some links with examples/documentation as you did not give any kind of information regarding what (I guess) CMS or service you are using.
Deliver more info and then there is a chance that someone will be able to help.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How would you make it so that a user is able to check their account information that is saved in the database and edit it? Let's say a user clicks on their account info page, it would display something like:
Username [abc]
Email: [aba#aba.abc]
Age: [20]
[Save Button]
When the user loads up the page, they would be able to see their information for those specified fields from the database. However, all this information would be in editable field that could be re-typed and saved.
So how would I go about doing this? What would this look like in PHP? I do not know how to display data from the databse onto a page, and I would imagine I would ned to do that. Also, does this data (that is being displayed on the page) need to be sanitized like how it was when the account was created?
There are many ways to approach this and unless necessary theres no need to reinvent the wheel.
A good place to start would be looking at the many open source projects that are out there such as:
UserFrosting - Modern user management for PHP #http://www.userfrosting.com
PHP Login #http://www.php-login.net
Alternativley frameworks such as Laravel, Yii2 and Symfony are a good environment to build these sort of systems in. With Laravel for example almost everything is configured for you out of the box. The authentication configuration file is located at config/auth.php, which contains several well documented options for tweaking the behavior of the authentication services.
After looking at these if you did decide you wanted to start from the ground up with your own design then there are many good in depth tutorials freely available online such as http://www.ineedtutorials.com/code/php/complete-advanced-login-member-system-php-tutorial
I hope my reply helps.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How would I go about creating a table that is linked to a specific user that can be edited by that user? Basically a user would log in, and they would see a button that took them to a page with a bunch of specifically labeled input boxes. They could put the appropriate data into the boxes and save it. There should also be a drop down menu that contains presets for the data. At first I thought to use a database, but here's the kicker: They need to be able to add and delete input boxes. To recap, the user needs to have their own specific page that allows them to change data in input boxes, as well as add more fields if they require it. This all needs to be stored and linked to their user. How can I do this?
You should realize that in PHP / MySQL. I do not know where you are in your project, if you have already achieved your login pages / sing_up / index ... etc.. but you should start with that. There are good tutorials on the subject, like this one.
http://net.tutsplus.com/tutorials/php/user-membership-with-php
EDIT:
To let user edit their info, look at this tutorial:
http://www.webestools.com/scripts_tutorials-code-source-14-members-area-system-in-php-mysql-members-users-system-area-log-sign.html
After, you will have to ajust your actual structure to the one they give.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Ok, I have built a custom CRM web app for a client using PHP and MySQL. The app seems to work really well for them and so I have decided to create a commercial version open to the public.
The basic idea of it is that it takes the data captured from a website and then populates the database with that. At the moment there is simply and insert statement on the front end of the website.
The thing is, I want people to be able to sign up to the service, create an account and customise it themselves to suit their needs. My idea is that once they sign up they would be provided with a form action that submitted to their account when installed on their page.
Regarding tables in the database etc, currently there is simply a customers table as there is only one website using it. If people being to sign up and use the service, do i create a new table for every account? This might be right but it seems a bit silly to me. Or is there a better way of going about this?
Usually, it's better to add a customer_id column, and add a WHERE customer_id=12345 clause to all your MySQL queries. Having a separate table per customer is certainly possible, but it may not scale as nicely.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Given a product id, associates have to navigate a vendors website, log in, perform a search, in order to get details on a product for a customer.
My employers want a program that can use the product id, and navigate the vendors website, and perform the search and everything to get the information thus saving the associate from having to manually repeat this task every time a customer wants more information about a product.
I know many sites use methods to prevent (CAPTCHA) exactly what I am trying to do. So I do not know if that automatically makes my given project an "evil" one. But I certainly do not have evil intentions, my employers simply want to save associates time on getting information that they are going to get regardless. However, if this is "evil" please explain why, so I can explain to my employers why we should not go down this road. That being said...
How can I make something like this in PHP?
It depends on what site you are trying to access. Many sites have an API that can be used to access data. If that's not the case, you may need to write a program that loads the html using a GET request, parses through the response, and retrieves the information you want. Without more details, that's the best answer I can give.
To start with I'd recommend reading up on cURL and DOM
cURL: http://php.net/curl (for fetching pages, even simulating search form)
DOM: http://www.php.net/manual/en/book.dom.php (to parse the fetched pages)