How do i secure my login. php page from sql injection attacks? i was told that my login page is still not secure even if i use the mysqli_real_escape_string function. can you please look at my code and show me a way i could better secure my login. here is the code:  &lt;?php session_start(); include("includes/config.php");  if(isset($_POST['login'])){ $email = mysqli_real_escape_string($connection,$_POST['email']); $pass = mysqli_real_escape_string($connection,$_POST['pass']); $pass = md5($pass);  $get_user = "SELECT * FROM members WHERE user_email='$email' AND user_pass='$pass'"; $run_user = mysqli_query($connection,$get_user); $check = mysqli_num_rows($run_user);  if($check==1){     $_SESSION['user_email']=$email;     $rows_check = mysqli_fetch_array($run_user);     $activate = $rows_check['activate'];      if($activate == 0){         echo "&lt;script&gt;window.open('lock_out.php','_self')&lt;/script&gt;";     }     if($activate == 1){         echo "&lt;script&gt;window.open('home.php','_self')&lt;/script&gt;";         $stat = 1;         $update = "UPDATE members SET online='$stat' WHERE       user_email='$email'";         $run_update = mysqli_query($connection,$update);                 } } else {     echo "&lt;script&gt;alert('Password or email is not correct!')&lt;/script&gt;";     echo "&lt;script&gt;window.open('index.php','_self')&lt;/script&gt;";   } } ?&gt;
How can I prevent SQL injection in PHP? 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?
I've been modeling a hermit crab and I don't know why but some areas of the mesh are really dark on some spots, like the legs and the claws.   I hope you can help me fix it. Expanding GCDs Reasoning: $\gcd(a,c) \cdot \gcd(b,c) = \gcd(ab,bc,ac,cc)$ I'm just wondering the reason behind being able to do this:  $$\gcd(a,c) \cdot \gcd(b,c) = \gcd(ab,bc,ac,cc)$$  Is there an elementary proof to the reasoning behind this? Where is .bash_profile? I want to put new aliases to my .bash_profile file, but I cannot find this file. Where is it supposed to be? Convergence of cos, sin, tan functions In Radian mode, continually pressing the $\cos$ function of a number causes the result to converge to $x=0.739085133$, a fixed point of $\cos(x)$. Repeating this behavior with the $\sin$ function causes the result to converge to $x=0$, a fixed point of $\sin(x)$.   What happens if this is done using the tan function? It seems that $x=0$ is a repelling fixed point with no convergence in this case.  What would be the best way to explain these results mathematically? Why is integration the inverse of differentiation Why is integration the inverse of differentiation, I mean why do I get the same function when I integrate and then differentiate the result? What do I need in order to create an application for ubantu? I am trying to find out whether $A = \begin{bmatrix}     3 &amp; 1 \\     0 &amp; 2 \\ \end{bmatrix}$ and $B = \begin{bmatrix}     4 &amp; 1 \\     -2 &amp; 1 \\ \end{bmatrix}$ are similar. Both matrices have the same trace, same rank, same determinant and the same eigenvalues. So I think they are similar. The eigenvalues are $3, 2$. Now I'm not sure how to find if they are indeed similar.   I am trying to find if there is a basis for $\mathbb{R^2}$ that contains only eigenvectors but when trying to solve $(3 I - A)v = 0$ there is no solution... What should I do from here? I'm trying to compute this integral, $$\int_{0}^{\infty}\frac{\ln x}{x^{a}(x+1)}dx \hbox{ where } 0&lt;a&lt;1$$ I drew a typical Pacman contour with branch cut at positive real axis. Then, we have $$\int_{\Gamma}\frac{\ln z}{z^{a}(z+1)}dz=\left(\int_{L_{1}}+\int_{L_{2}}+\int_{C_{R}}+\int_{C_{\epsilon}}\right)\frac{\ln z}{z^{a}(z+1)}dz$$ The function has a pole at $z=-1$. Then, by residue theorem, the whole integral becomes  \begin{align*} \int_{\Gamma}\frac{\ln z}{z^{a}(z+1)}dz&amp;=2\pi i\text{res}(\frac{\ln z}{z^{a}(z+1)};-1)\\&amp;=2\pi i\lim_{z\rightarrow-1}(z+1)\frac{\ln z}{z^{a}(z+1)}\\&amp;=2\pi i\lim_{z\rightarrow-1}\frac{\ln z}{z^{a}}\\&amp;=2\pi i\frac{\ln e^{i\pi}}{e^{i\pi a}}\\&amp;=2\pi i\frac{\ln1+i\pi}{e^{i\pi a}}\\&amp;=-\frac{2\pi^{2}}{(e^{i\pi})^{a}} \end{align*} On $L_1$, $z=xe^{i\epsilon}$ where $\epsilon\leq x\leq R$  On $L_{2}$, $z=xe^{i(2\pi-\epsilon)}$ where $\epsilon\leq x\leq R$  On $C_{R}$, $z=Re^{i\theta}$ where $\epsilon\leq\theta\leq2\pi-\epsilon$  Lastly on On $C_{\epsilon}$, $z=\epsilon e^{i\theta}$ where $\epsilon\leq\theta\leq2\pi-\epsilon$  So I tried to compute them separately and I anticipate the curves will both go to $0$ by ML inequality, and two linear integrals will consist of the term $\int_{0}^{\infty}\frac{\ln x}{x^{a}(x+1)}dx$ and hence simply solve for it. But I'm having trouble physically solving it out. I think the log is throwing me off. Can anybody please help me? Any option for mysqldump to ignore databases for backup? I am trying to ask a question on SE, have some mock data in Excel I've copied, and am simply trying to paste in to my question.  I've done this before dozens of times, but suddenly am having this issue.  However, when I do so, I get prompted to upload an image. (This happens with Ctrl + V and also right click --> Paste):    Am I overlooking something?  Edit: Playing around, I can copy from Firefox/browsers and Word, and paste in to the box as usual. Excel seems to be the only one giving the issue so far.  Edit2:  are still having this issue. Chrome: remove URL from autocomplete which doesn't show up in history? I accidentally visited gist.gihub.com (note the missing t), and now that URL auto completes each time I start typing gist.…. How can I remove this URL?  I've tried removing it from my history, but that doesn't help:     (note the empty search results) Title tag different from title appearing in Google? I am a newbie in linux. I wanted to install ubuntu to my desktop. I currently have two partitions, Windows 8 in installed on one, and i have some important files in another partition. While installing ubuntu, if I chose "Replace Windows 8 with Ubuntu", do I lose the other partition too?   And are there other ways to leave the other partition as it is, and install ubuntu in the partition  where windows was installed. Characterization of weak convergence in $\ell_\infty$ Is there some simple characterization of weak convergence of sequences in the space $\ell_\infty$? If yes, is there some similar claim for nets?   I was only able to come up with a characterization of sequential weak convergence using limit along ultrafilters, which I will describe below. I wonder whether there is some insight into this characterization. (E.g. whether there is some simple reformulations which does not use ultralimits.) Moreover, I do not know whether at least this characterization works for nets, too.  We have the following result describing weak convergence in $C(K)$, see e.g. Corollary 3.138,  in Banach Space Theory by Fabian, Habala et al. (It is a consequence of Rainwater theorem and characterization of extreme points of unit ball in $C(K)^*$.)     Let $K$ be a compact topological space. Let $\{f_n\}$ be a bounded sequence in $C(K)$ and $f\in C(K)$. Then, if $f_n\to f$ pointwise, we have $f_n\overset{w}\to f$.   Moreover we have isometric isomorphism between $\ell_\infty$ and $C(\beta\mathbb N)$, which is described e.g. in the Wikipedia article on  or in  of Carothers' book A short course on Banach space theory. This isomorphism assigns to each bounded sequence $(x_n)$ the continuous function $\overline x$ on $\beta\mathbb N$ defined by $$\overline x(\mathscr U) = \operatorname{\mathscr U-lim} x_n,$$ where $\operatorname{\mathscr U-lim} x_n$ denotes the  of $x_n$ w.r.t the ultrafilter $\mathscr U$.  Combining the above results we get the following characterization:      Let $f^{(n)},f\in\ell_\infty$. The sequence $f^{(n)}$ converges to $f$ weakly if and only if for every ultrafilter $\mathscr U$    $$\lim_{n\to\infty} \operatorname{\mathscr U-lim} f^{(n)}= \operatorname{\mathscr U-lim} f.$$   (The above claim for principal ultrafilters is just a pointwise convergence. But in the above claim the equality is required for free ultrafilters, too.) How to analyse 'Element not Found' exceptions when working with Selenium If $f:E\rightarrow S$ is an elliptic curve over a scheme $S$ (so $f$ is proper and smooth of relative dimension one with geometrically connected fibers of genus one, equipped with a section $0:S\rightarrow E$), then is the sheaf $\underline{\omega}_{E/S}:=f_*\Omega_{E/S}^1$ actually free of rank one? According to the statement of Grothendieck-Serre duality in Hida's book Geometric Modular Forms and Elliptic Curves, there should be a canonical isomorphism $\underline{\omega}_{E/S}\cong\mathcal{Hom}_{\mathscr{O}_S}(R^1f_*\mathscr{O}_E,\mathscr{O}_S)$, and the first result on elliptic curves in this book is that $R^1f_*\mathscr{O}_E\cong\mathscr{O}_S$. It's also not clear to me whether $S$ is being assumed (locally) Noetherian, but if that's necessary for Grothendieck-Serre duality to hold, then I'm fine with assuming it. I can't find another reference with a statement of Grothendieck-Serre duality in this generality which does not use the language of derived categories (which I unfortunately don't understand).  The reason I'm kind of skeptical about this is that in Hida's book, as well as in Katz-Mazur, it is said that $\underline{\omega}_{E/S}$ is invertible, so that an $\mathscr{O}_S$-basis $\omega$ for $\underline{\omega}_{E/S}$ can be found locally on $S$. If the invertible sheaf in question were really trivial then one would be able to choose a global $\mathscr{O}_S$-basis for $\underline{\omega}_{E/S}$, and there would be no reason to talk about doing so locally. Hida goes on to say that, choosing an $\mathscr{O}_S$-basis $\omega$ locally on $S$ allows one to regard $(\Omega_{E/S}^1,\omega)$ as a relative effective Cartier divisor in $E/S$, which also doesn't make complete sense to me because if we can only find $\omega$ locally, how are we getting a global section $\omega\in H^0(E,\Omega_{E/S}^1)=H^0(S,\underline{\omega}_{E/S})$ (unless $\underline{\omega}_{E/S}$ really is trivial)? What exactly is the point of memoryview in Python Showing a compact metric space has a countable dense subset I know that this is separable, but that has not been covered by the text at this point. I believe my proof (below) to be correct, but not very rigorous. Assuming that it actually is correct, could someone please help me make it more formal? (If it's not correct, please help with the proof). Thanks.  Proof: Let $X$ be a compact metric space. Let $B_n = \{B(x,\frac1{n}) : x\in X\}$. be the collection of open balls centered at $x$. Let $\{x\}^{(n)}$ be the set of centers for some particular $n$. Then by compactness of $X$, there are also a finite number of centers for a particular $n$ (corresponding to each open ball).   [This is where I have trouble properly saying what's on my mind:]  Consider $B(x,r_0)$, where $r_0 = \frac{1}{n_0}$. When we decrease the magnitude of $r_0$ to $r_1$, we must still be able to cover $X$. Meaning some open ball(s) must be "formed" where $B(x,r_0)$ was once "covering". So by adding open balls, we also add to our collection of centers. This means at $B(x,r_0)$, there was originally a point $y \in B(x,r_0)$ s.t. $B(y,r') \subset B(x,r_0)$ for some $r'$. That is, $B(x,r_0)$ contained another point of $X$. Thus, by definition, $X$ contains a countable dense subset. I currently only have remote access to this CentOS box, I need to move /var form the primary RAID to a new set of disks that was installed with more space, My current thoughts on how to accomplish this is to temporarily mount the new RAID to /tmp/var. rsync everything from /var to /temp/var then modify the fstab to point /var at the new disks.  Here is my question. how do I delete the existing /var on the primary disks once I have the new disks mounted to that location (assuming this is even possible remotely)? What is a tty, and how do I access a tty?