I am trying to learn and better understand how to properly prevent sql injection and properly extract database information to show in a website.  I am currently using mqli_real_escape_string but the problem is when I extract the data there is a slash where the user may have entered an apostrophe or a quote, such as O'Connell, etc...  If I use a function to remove slashes, it defeats the purpose of using the mqsli_real_escape_string.  What is the proper way to prevent injection while allowing usage of apostrophes where necessary?   MySql  $name = mysqli_real_escape_string($link, $_POST['commentName']); $comment = mysqli_real_escape_string($link, $_POST['commentMessage']); $BID = mysqli_real_escape_string($link, $_POST['BID']);   HTML/PHP  &lt;div class="uname"&gt;&lt;?php echo $name ?&gt;&lt;/div&gt; &lt;div class="comment"&gt;&lt;p&gt;&lt;?php echo $comment ?&gt;&lt;/p&gt;&lt;/div&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?
Where can I find sample or real Selenium projects. All the material I can find on github and on internet are basic, and never intermediate or advanced.  How does a real Selenium project look in real life? How can I find sample code? Which is correct?   Sheila and Angie are wearing the same shirt today.  Sheila and Angie are wearing the same shirts today. Sheila and Angie are wearing same shirts today. At the end of the game, how are medals awarded?   As a secondary, what is the relation between bronze silver and gold medals, and how much experience do they reward? Detecting structured data in Google Webmaster Tools I was curious about the date in URL segments, is there any SEO point of benefit? For example the following URLs:  http://techcrunch.com/2013/06/18/netflix-will-launch-in-the-netherlands-later-this-year-as-its-international-expansion-slows/ http://tips-for-new-bloggers.blogspot.in/2007/02/adding-favicon-icon-to-blogger-url.html  https://community.jivesoftware.com/blogs/jivespace/2013/05/15/eol-of-the-html5-ipad-web-app   In all the above URLs there is date segment. The information of those blogs can be fetched via blog stub like "netflix-will-launch-in-the-netherlands-later-this-year-as-its-international-expansion-slows" so why to use that date part? Are there expected dressing norms at faculty interviews? Will a casual tee-jeans be discouraged?  In the same vein, what is expected when a student visits the campus for an interview? What's a recommended alternative to Quickbooks pro? I've just installed Ubuntu to replace Windows. I can't seem to find a good alternative to  to run on Ubuntu. Any help would be appreciated. I've just gotten started with Nielsen and Chuang's text, and I'm a little stuck. They mention that theoretically, it would be possible to store an infinite amount of information in the state of a single qubit. I'm not sure I completely comprehend this.    Here's how I rationalized it: You take all the information you want to store, put it in binary form, and make it the real component of $\alpha $ or $\beta$ (the coefficients of the computational basis states).   Now I'm not sure if I've understood it right, but since it's still fuzzy in my head it would be great to get some kind of ELI5 explanation or possibly a more detailed picture of how this would, even theoretically, be possible.    Apologies if the question doesn't meet standards. I'm new to the forum and would be open to feedback regarding asking questions or answering them. Quotient of the ring of integers of a number field by a prime ideal A friend offered me a brain teaser to which the solution involves a $195$ pound man juggling two $3$-pound balls to traverse a bridge having a maximum capacity of only $200$ pounds. He explained that since the man only ever holds one $3$-pound object at a time, the maximum combined weight at any given moment is only $195 + 3=198$ pounds, and the bridge would hold.  I corrected him by explaining that the acts of throwing up and catching the ball temporarily make you 'heavier' (an additional force is exerted by the ball to me and by me onto the bridge due to the change in momentum when throwing up or catching the ball), but admitted that gentle tosses/catches (less acceleration) might offer a situation in which the force on the bridge never reaches the combined weight of the man and both balls.  Can the bridge withstand the man and his balls? How do I get attention for one of my own questions without a good answer? Two of my friends are getting married. They're both huge Doctor Who geeks, and actually met through a DW RPG. Their wedding invitation contained a very subtle DW reference (you wouldn't have been able to tell unless you were very familiar with the show yourself.)   Doctor Who's been running long enough that there are quite a few nice quotes for basically every occasion in life. I was hoping someone would know a nice wedding-related one, or maybe one about love, that I could include in a wedding card? Is this an instance of Priori Incantatem? During the climax of Fantastic Beasts and Where to Find Them, Tina briefly duels with Graves and their wands appear to lock with each other (see picture). I believe this also happens some other times in the later Harry Potter films other than Harry and Voldemort's duel in the graveyard during Goblet of Fire.    We know that this is definitely a case of Priori Incantatem for the graveyard duel in Goblet of Fire, as the wands are locked for a sufficient amount of time for past spells to begin showing themselves (significantly, showing the people Voldemort had murdered), but is this the case for the other instances of wands locking? If so, does that mean there are a lot more wands out there with shared cores, as it was my understanding this could only happen if that criteria was satisfied? What is the meaning of equation of a circle or equation of a cube? We have an equation of a Circle $$x^2 + y^2 = 1$$ and equation of a Cube $${||x-y|+|x+y|-2z|+||x-y|+|x+y|+2z|=1}$$  When I substitute x,y in first equation or x,y,z in the second equation then the equations are said to be satisfied when LHS and RHS are equal.  I have a quick question. If the first equation or second equation get satisfied, because LHS becomes equal to RHS, then those values of x and y of first equation are said to be lying on the circumference of the circle and not inside or outside of the circle and x,y,z of the second equation are said to be lying on the surface of the cube and not on the inside and not on the circle of the cube. Correct? Index entries duplicated for captions Can any one tell me the advantage of synchronized method over synchronized block with an example? In the late 1970s I bought a book at a school book fair (likely published by Scholastic) about a young boy who lived on a generational starship.  The ship was failing.  I remember some bit about an icey cold airlock.  One of the constellations (Cygnus) somehow took on actual fleshy form and manifested as a talking swan, which somehow helped the starships reach their destination.  Pointers? Indefinite integral of $ \int \frac{x^3}{\sqrt{x^2+1}} \,\text{d}x$. Can you please provide any sort of hint or suggestion on how to find the following indefinite integral?  $$\int\frac{x^3}{\sqrt{x^2+1}}\text{d}x$$  I tried substituting everything but it didn't work. I also tried trigonometric substitution but I couldn't find any valid trigonometric identity for $ \sqrt{\cos^2(x)+1} $ or $ \sqrt{\sin^2(x)+1} $. "really not" vs "not really" If someone says "David is not really a leader", it means something like: the speaker believes that David isn't the kind of person you would think of as a without-doubt a real leader; but the speaker isn't necessarily saying that David is definitely a very poor leader.  If someone says "David is really not a leader", it means that the speaker thinks that David is definitely a very poor leader.  What analysis (grammatical, dictionary, etc?) can help me understand how this difference in meaning is created? Which repository source do I need to add to my sources.list to access the package firmware-linux-nonfree?  I am using Deb 6 testing 32 bit.