Answer the question
In order to leave comments, you need to log in
Problem with arrays and loop. D / Z (2 course techie). How to do?
Get an n*m matrix randomly between -50 and 50. Calculate the sum and number of positive elements of a c# matrix.
How to calculate the sum and number of positive matrix elements?
Matrix already written:
int n, m, sum;
Console.WriteLine("Введите n");
n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите m");
m = Convert.ToInt32(Console.ReadLine());
sum = 0;
Random r = new Random();
int[, ]a = new int[n, m];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
a[i, j] = r.Next(-50, 50);
Console.Write("\t" + a[i, j]);
}
Console.WriteLine();
}
Answer the question
In order to leave comments, you need to log in
Maybe it's better to just write something to the session, for example, $_SESSION['auth'] = 1
Forge session == forge session id cookie. If an attacker has session cookies, then it doesn't matter how you store authorization in the session. If they are not there, then the fact that the session is just an authorization flag will not help him in any way. In terms of security, these two methods - storing auth=1 or some kind of hash there are no different. Well, it’s a bit of a stretch to say that auth=1 is a little safer, because you store the hash of the password, which means that if the session files are received, the attacker has a hypothetical chance to try to recover the password using the hash if he gets the session files .
Firstly, before checking, you need to filter the forms, you can slip different javascript scripts and dangerous code that can hack your site...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question