Hello
it is such that I started making so that you can create user on the website, but I can not really comment on,
it is such that it should find out about the guest's e-mail found in the database because doing it so it must not create user but in fashion if none is found then you have to be sustained in the database.
- Are the use must come up with errors to the page.
- It will not be with some email outcome you should be sustained in the database with the email and the other information you need.
string fejl = "Hov Hov, Du skal læse vore betingelser"; if(CheckBoxBetingelser.Checked) { //opretter adgang til databasen. SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString()); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; //Angiver brugernavn skal være med stort! string brugernavn = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(TextBoxBrugernavn.Text); //skal finde ud af brugen findes i databasen cmd.CommandText = "SELECT Id, brugernavn, rank FROM brugere WHERE brugernavn = @brugernavn"; cmd.Parameters.AddWithValue("@brugernavn", brugernavn); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); if(reader == null) { //ligger noget sikkert på password string adgangskode = MD5.Encrypt(TextBoxAdgangskode.Text); string fornavn = TextBoxFornavn.Text; string efternavn = TextBoxEfternavn.Text; cmd.CommandText = @"INSERT INTO brugere (brugernavn, adgangskode, fornavn, efternavn) VALUES (@brugernavn, @adgangskode, @fornavn, @efternavn);"; cmd.Parameters.AddWithValue("@brugernavn", brugernavn); cmd.Parameters.AddWithValue("@adgangskode", adgangskode); cmd.Parameters.AddWithValue("@fornavn", fornavn); cmd.Parameters.AddWithValue("@efternavn", efternavn); Response.Redirect("login.aspx"); } else { LabelErrorBesked.Text = "Hov hov, du fik en fejl ved log ind!"; } conn.Close(); } else { //det er hvis at man ikke har klik på checkbox LabelError.Text = fejl; }
I'll just say that it is the first time that I work with asp.net when I in the past has worked with php, but is starting on an IT training where my teacher has shown some cool stuff.
I would just build it up like this if it was me but it will be super nice if you could explain to me what I might have to change or do better,
it is such that I am dyslexic and has trouble spelling for some things.
I typed my comment in Danish.