I want to know about my database how much secure in this way ? What else can i do for more security ? Is htmlentities and mysqli_real_escape_string enough combo for security?  &lt;?php require 'db.php'; $mysqli2 = new mysqli('localhost','x','x','x'); session_start(); $_SESSION['message'] ='';  if (isset($_POST['username'])){     /* User login process, checks if user exists and password is correct */      // Escape email to protect against SQL injections     $username= htmlentities($_POST['username']);     $username = $mysqli-&gt;real_escape_string($username);     $result = $mysqli-&gt;query("SELECT * FROM accounts WHERE username ='$username'");      if ($result-&gt;num_rows == 0){ // User doesn't exist         $_SESSION['message'] = "You should register !";         header("location: error.php");     }     else { // User exists         $accounts = $result-&gt;fetch_assoc();         $password= htmlentities($_POST['password']);         $password = $mysqli-&gt;real_escape_string($password);         if ( password_verify($password, $accounts['password']) ) {              $_SESSION['username'] = $accounts['username'];             $_SESSION['usercode'] = $accounts['usercode'];             $usercode= $_SESSION['usercode'];             $_SESSION['email'] = $accounts['email'];             $_SESSION['active'] = $accounts['active'];             $result2 = $mysqli2-&gt;query("SELECT * FROM account_info WHERE usercode ='$usercode'");             $account_info = $result2-&gt;fetch_assoc();             $_SESSION['name']= $account_info['name'];             $_SESSION['lastname']= $account_info['lastname'];             $_SESSION['location']= $account_info['location'];             $_SESSION['phone'] = $account_info['phone'];             $_SESSION['balance'] = $account_info['balance'];             // This is how we'll know the user is logged in             $_SESSION['logged_in'] = true;              header("location: index.php");         }         else {             $_SESSION['message'] = "You have entered wrong password, try again!";             header("location: error.php");         }         }     }  ?&gt;
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?
Uncertainty principle and multiple observers I am a girl in my early twenties traveling to USA from India and in my visa application I have provided the contact address for a relative in San Francisco, and their invitation letter. I would like to visit LA first. Will I face problems during immigration if I land in LA (with an immediate on wards ticket to SF)? I dont plan to get on the flight from LA to SFO.  Initially I was planning to fly to SFO from India and then fly to LA immediately after completing immigration at SFO airport. Give a sequence $(f_n)_{n\in \mathbb{N}}$ of differentiable functions which uniformly converge to $0$, but for which the seqeunce $(f_n')_{n\in \mathbb{N}}$ of the derivatives isn't even pointwise convergent.    I found this one in my textbook marked as "Fun things to solve" and although it may be fun, it's kind of hard to do.   To be honest I already failed at the first hurdle. I couldn't even find a sequence of functions which uniformly converges to $0$.   Is there a certain way of dealing with this kind of problem? Because it seems kind of hard for me to come up with sequences without a mathematical of way of doing so (or maybe there is a mathematical way I just don't know yet). Is there any hint that some of the beings in Tolkien's lore may have survived into "our" times? In Tolkien's lore, they are many very old beings. Is there any indication that some or even one would have been truly immortal and survived into what we would call "our" history or Age? Galadriel, Cirdan, Ingwe, Bombadil, Ungoliant, or any Maia or Ainur? Anyone or anything? Seems there must be some kind of carry-over seeing as how "man" existed in this time. Can I uninstall and reinstall Ubuntu Software Center? When I have .txt files or .py files, I can Quick Look those files in Finder. I have .jl files that are codes written in the Julia Language. Of course they are text files. They will open in a text editor like Sublime Text. How can I Quick Look these .jl files in Finder? Creating a row for each value in a comma-separated string I'm currently trying to create a View from a Table that does the following:  Table A ╔═════════════╦═══════════════╗  ║ PART NUMBER ║   FILE NAME   ║ ╠═════════════╬═══════════════╣ ║  PN0001-01  ║      FOO      ║ ║  PN0002-01  ║      BAR      ║ ║  PN0003-01  ║    FOO,BAR    ║ ║  PN0004-01  ║  BAR,FOO,FOB  ║ ╚═════════════╩═══════════════╝   To create  View B ╔═════════════╦═══════════════╗  ║ PART NUMBER ║   FILE NAME   ║ ╠═════════════╬═══════════════╣ ║  PN0001-01  ║      FOO      ║ ║  PN0002-01  ║      BAR      ║ ║  PN0003-01  ║      FOO      ║ ║  PN0003-01  ║      BAR      ║ ║  PN0004-01  ║      BAR      ║ ║  PN0004-01  ║      FOO      ║ ║  PN0004-01  ║      FOB      ║ ╚═════════════╩═══════════════╝   So, essentially, I need to take records from Table A and insert them into View B, where if the record from A has a LIKE '[,]' property, then that field is split into multiple records in B, depending on the number of times the ',' is present, with the text between each ',' being given its own record in View B. Going to any question on the site brings an error page Simulating data to fit a mediation model I am interested in finding a procedure to simulate data that are consistent with a specified mediation model.  According to the general linear structural equation model framework for testing mediation models first outlined by  and described elsewhere such as , mediation models for outcome $Y$, mediator $\newcommand{\med}{\rm med} \med$, and predictor $X$ and are governed by the following three regression equations: \begin{align} Y    &amp;= b_{11} + b_{12}X + e_1                \tag{1}  \\ \med &amp;= b_{21} + b_{22}X + e_2                \tag{2}  \\ Y    &amp;= b_{31} + b_{32}X + b_{32} \med + e_3  \tag{3} \end{align} The indirect effect or mediation effect of $X$ on $Y$ through $\med$ can either be defined as $b_{22}b_{32}$ or, equivalently, as $b_{12}-b_{32}$.  Under the old framework of testing for mediation, mediation was established by testing $b_{12}$ in equation 1, $b_{22}$ in equation 2, and $b_{32}$ in equation 3.  So far, I have attempted to simulate values of $\med$ and $Y$ that are consistent with values of the various regression coefficients using rnorm in R, such as the code below:  x   &lt;- rep(c(-.5, .5), 50) med &lt;- 4 + .7 * x + rnorm(100, sd = 1)   # Check the relationship between x and med mod &lt;- lm(med ~ x) summary(mod)  y &lt;- 2.5 + 0 * x + .4 * med + rnorm(100, sd = 1)  # Check the relationships between x, med, and y mod &lt;- lm(y ~ x + med) summary(mod)  # Check the relationship between x and y -- not present mod &lt;- lm(y ~ x) summary(mod)   However, it seems that sequentially generating $\med$ and $Y$ using equations 2 and 3 is not enough, since I am left with no relationship between $X$ and $Y$ in regression equation 1 (which models a simple bivariate relationship between $X$ and $Y$) using this approach.  This is important because one definition of the indirect (i.e., mediation) effect is $b_{12}-b_{32}$, as I describe above.  Can anyone help me find a procedure in R to generate variables $X$, $\med$, and $Y$ that satisfy constraints that I set using equations 1, 2, and 3? For $x$ and $\lambda$ complex, if $|x| \gt \frac{1}{2} + \sqrt{\frac{5}{4} + |\lambda|}$ then $|x^2+\lambda| \gt |x| +1$ Not able to query standard user field 'StartDay' in salesforce I want to query start of day and end of day field from the user object but I am getting error for that refer images for more details Let $f,g:X\to Y$ be maps of spaces such that $f\simeq g$. Is it true that the mapping cones $\operatorname{cone}(f)$ and $\operatorname{cone}(g)$ are homotopy equivalent?  Can we write down an explicit homotopy equivalence? It ought not to be too hard to get a map $\operatorname{cone}(f)\to \operatorname{cone}(g)$ from the existence of a homotopy $H:X\times I\to Y$, but I haven't been able to find a sensible candidate, despite trying for quite a while. Is there any scientific experiment that can lead us to conclude we live in 3 spatial dimensions without the premise of the conception of limited dimensions?  Thank you all who helped in the improvement of this question (which was not clear at first).   EDIT:  I know that this can be a little philosophical, but it is also a scientific question.  Let's consider the scenario where the mankind was not ever able to see.  Let's also consider that this limitation could be surpassed thus not limiting us to reach a scientific and technological knowledge "similar" to what we have today.  Would this civilization of blind people reach the conclusion that they are living in a 3D spatial world?  Is the sense of touch enough to reach that conclusion? Is there any scientific experiment that can lead us to that conclusion without the premise of the conception of limited dimensions?  Would it be easier, harder, or just different to reach a conclusion predicted by the M-Theory? (please do not focus only on this last question) Is is possible to convert a .vdi file into a .iso that can be burned to a cd or dvd and make it like an installer. Or Is it possible to convert virtual machines to physical environments? "Whether or not" vs. "whether" This will depend on whether he's suitable for the job.    This will depend on whether he's suitable for the job or not.   This will depend on whether or not he's suitable for the job.         It is still not defined whether we're following that approach.   It is still not defined whether we're following that approach or not.   It is still not defined whether or not we're following that approach.         "Or not" doesn't really seem to be needed to complement "whether". Why do people use it then? Is it redundancy and nothing more? Or is it for emphasis? Or are there cases when "or not" is required for the sentence to be grammatical? When a/an precedes a parenthetical aside (sometimes seen in informal/conversational writing), should the vowel rule depend on the first word in parentheses, or the next word in the "regular" flow of the sentence?     I need a (memorable) idiom (preceding an m word; use a)   or     I need an (memorable) idiom (preceding an i word; use an) Given $\frac{a}{c} + \frac{b}{d} = 1$ Prove that $$\lim_{(x,y)\rightarrow(0,0)} \frac{|x|^{a}|y|^{b}}{|x|^{c} + |y|^{d}}$$ does not exist.  So I have done the proof for strict inequalities. And the limit only exists when the fractions add up to an integer greater than $1$. I'm not sure how to approach this other than counter examples. Does anyone know where I can find cheat codes for Goldeneye 007 Wii? I know that the game hasn't even been out for a week, but does anyone know if any cheat codes have been released by Activision yet?  I know that they must exist since there is a cheat codes menu within the game. Why non-measurable sets exist? What Is the reason behind the fact that $\Bbb R$ is not a complete measure space? Is it only due to the cardinality of  $\Bbb R$? Or other structures on  $\Bbb R$ also play a role? Can one make every subset of  $\Bbb R$ trivially measurable by assigning them to a number of a complete ordered field of the cardinality $\aleph_2$ ? Git - how to force merge conflict and manual merge on selected file