I want to make it so that people can log into an account that they've made using a signup form and I also want to make it so that when the account is created they it makes a profile page where they can edit their profile picture, banner, and bio.
I'm very new to well... everything so I need this explained in as much detail as possible.
The concept is simple, consider the following
1.It can be done if you have implement a login system. First you should have page for the user profile, like changing name, picture, etc....
2. Once they register you store the data in the db, with the user id (it can be auto increment column.
3. In you navigation have link for user page, once use click it show page you created for user profile.
4. When user login, store their user id in session, then based on their user id you can retrieve the information and show.
5. The entire page input elements has to be inside a form tag, so if user edit something and click on the update button (or any name you wish) it will update the values in the db.
Basically in the register you will have the insert coding for the user table, and in the user profile page you will have the update coding.
Hope you get the idea!!
Related
I have a web page showing multiple fields and a button for each of the fields which are editable.
As an example a page is showing name, age, address, nationality,salary and gender out of which say address and salary are editable. There are 2 update buttons at the bottom of the page namely
update salary
update address
Clicking on each of these buttons opens a form for the necessary edits. I would like to move the edit next to the displayed field where ever applicable and show it as a pencil. This way the page will look less cluttered when multiple fields are editable.
Any suggestion as to what can be used? I have bootstrap 4.x in my project but not sure what to use from here as I have some basic idea on Bootstrap. The project is based on Angular.
I have an application in which a user can create a sport, also any user can register to the sport by selecting it. I'm trying to use radio buttons as i intend for any user to be able to select more than one, but i'm having issues with radio_button_tag and collection_radio_button . collection_radio_button only shows one option and both still needs a label. I want to be able to pass the sports created in the view (using radio button) as a hash so that it can be dynamically increased or reduced as the sports are created by users. Also please is there another option that's workable and not necessarily radio buttons.
Here,the scenario should allow user to add multiple sports.so you should use checkboxes and the code is
<label>Cricket<input type="checkbox"/></label>
So no SQL tables or anything here. Basically, I have 3 pages that have 6 items each. Each item consists of an image and then some text and also a smaller image than changes from a check to an "x" depending on if user selects or not. So if the image is checked, the user is adding that to a list which would display on a fourth page. This data needs to persist through just a session and if the session times out, then it resets. If the list is complete and on that fourth page the user choices to email or share list via social sharing, then the data would be gone after that action. What I am trying to figure out is the best way to approach and implement this with minimal time and effort as it has to go out quickly. Can any of you explain and maybe point to some links with info on the best way to achieve?
This is being done in asp.net web forms with html, css, and javascript.
Much appreciated!
You can use ViewBag() (for view in razor) or ViewData[] (for page in .net) to hold data for one web page.when you want it to other page. You can pass it to other page.
check this out
ViewBag, ViewData and TempData
I'm using an approach but I don't know if it's wrong.
When I connect to the database in my website, the ResultSet will return the "Username" and the "UserId".
while(rset.next()) {
//I place the Username inside a DIV, which is visible
//I Place the UserId inside another Div, which is not visible
}
I place the UserId because I need to grab them later for jquery and Ajax requests, when I view the source code, those UserIds are visible in the source code.
Means anyone can know the id of the listed users, or any other thing that has an id, does this weaken the website's security?
As long as that information doesn't help an attacker to get:
Access to your server/database
Access to a different user's account
Sensitive information about your users
Then it is okay to put it "publicly". For example, here on Stack Overflow, my user ID is 871050, it won't help you achieve either of the goals listed above, so it's fine for you to see it.
I have a html drop down list in my web site. When the user selects a particular item in the list I want it to be shown in all the pages when the user navigates through the site.How Can I do that??
I am using visual studio 2010 and mvc3 views. Currently what happen is when the user selects a particular item,the selected value only stays for the current page, when I go to another page, the default value, which is the very first item in the list is shown.
How can I have persistent dropdown list value??
Thanks.
There are different ways to achieve this. You could store it in Session or Cookies. So for example on the first page create a form containing the DropDown with a submit button. When the user clicks on the submit button the form will post the selected value back to the server and the server could either store it in Session or client side cookie. Then the controller action could redirect to some other action which will be able to retrieve the value. And from now on this value will be available on all subsequent requests.