Code:  $gameID= $_GET['gid']; $con = mysql_connect($dbserver,$dbuser,$dbpassword); if (!$con) {    die('Could not connect: ' . mysql_error()); }  mysql_select_db($dbname, $con);  $sqlselect="SELECT * FROM games WHERE gameid=" . $gameID; $result = mysql_query($sqlselect);  $row = mysql_fetch_array($result); $gwidth =  $row['width']; $gheight = $row['height'];  if($gwidth &gt; 700)&lt;br /&gt; {   $gwidth = $gwidth * 0.75;   $gheight = $gheight * 0.75; }   can anybody tell me how to secure this sql queries ?  VULNERABILITY: CLASSIC MYSQL INJECTION
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?
Do shots fired before the match starts count towards your end-of-game statistics? In Overwatch, there is short countdown for a few minutes before the match begins. During this time, the defending team is allowed to roam the map to set up their defenses, while the attacking team sits in a small lobby until the game starts and the doors open. (Or in KotH-type maps, both teams wait in a lobby.)  While players wait, it's not uncommon for them to fire off random shots, especially since a lot of the environment is destructable (it's entertaining to watch plush onions sail through the air in the arcade).   Do shots fired before the match starts count towards accuracy statistics at the end of the game? In Data Extension one field 'HTML' have Data that I have shown below, Now I have to Find the 'Href', and and at the last of URL append some text like '&amp;MC='. It may have Multiple 'Href'. Please help me on this.   &lt;table width="540" style="margin: 0px; padding: 0px;" bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0"&gt;  &lt;tbody&gt;   &lt;tr&gt;    &lt;td valign="top"&gt;    &lt;h5 style="margin: 0px; padding: 0px 0px 2px; line-height: normal; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: normal;"&gt;    &lt;a style="text-decoration: none;" href="https://test.4.com/testRegistration/testLobbyServlet?target=reg20.jsp&amp;eventid=897605&amp;sessionid=1&amp;key=2F3D1EB963D9DB7738BF2877DFFDBA01&amp;partnerref=Social&amp;sourcepage=register&amp;loc=zOTlocz&amp;prod=zWAz&amp;tech=zsecz&amp;prog=zOTprogz&amp;type=zOTtypez&amp;media=zWCz&amp;country=zUSz" alias="Success with Enterprise Mobility: Making email and Office 365 secure on mobile devices"&gt;    Success with Enterprise Mobility: Making email and Office 365 secure on mobile devices     &lt;/a&gt;    &lt;/h5&gt;    &lt;p style="margin: 0px; padding: 0px; line-height: 20px; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal;"&gt;    &lt;span style="color: rgb(103, 103, 103);"&gt;    &lt;em&gt;December 9, 2014, 10:30 A.M.&amp;ndash;11:30 A.M. Pacific Time&lt;/em&gt;&lt;br&gt;    An enterprise mobility strategy involves identity, management, and productivity. In this session featuring Brad Anderson, you will learn about the integration and the Office mobile apps while enabling secure mobile productivity.    &lt;/span&gt;    &lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;    &lt;td valign="top"&gt;&amp;nbsp;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;    &lt;td valign="top"&gt;    &lt;h5 style="margin: 0px; padding: 0px 0px 2px; line-height: normal; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: normal;"&gt;    &lt;a style="text-decoration: none;" href="http://test.TTr.com/?Wt.mc_id=IG15W2NWTN&amp;loc=zOTlocz&amp;prod=zWAz&amp;prod=zWSz&amp;tech=zCLz&amp;prog=zOTprogz&amp;type=zEVz&amp;media=zOTmediaz&amp;country=zUSz" alias="Test: Everything about enterprise technology under one roof"&gt;    Test: Everything about enterprise technology under one roof    &lt;/a&gt;    &lt;/h5&gt;    &lt;p style="margin: 0px; padding: 0px; line-height: 20px; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal;"&gt;    &lt;span style="color: rgb(103, 103, 103);"&gt;    &lt;em&gt;May 4&amp;ndash;8, 2015, Chicago, IL&lt;/em&gt;&lt;br&gt;    If you&amp;rsquo;re serious about technology, you don&amp;rsquo;t want to miss Test. This event will be the intersection of everything in enterprise technology. Get ahead in your job and your career.    &lt;/span&gt;    &lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;  &lt;/tbody&gt; &lt;/table&gt; How do I get rid of the Start Menu "zombie" icon? Windows 7 has a large icon above the username on the right-hand pane of the Start menu. By default it is a faceless torso in a blue collarless shirt that I call the "zombie icon". (I don't know the icon's real name: . (Although "Molly Clark" has a zinnia icon instead of a zombie icon.)  The zombie icon fades from one pointless icon to another as you move your mouse over "Documents", "Computer", "Devices and Printers" etc. This icon is a waste of space and the fades are distracting.  How do I make it go away? Suppose $n$ is an even positive integer and $H$ is a subgroup of $\mathbb Z/n \mathbb Z$. Prove that either every element of $H$ is... I was wondering if there are functions for which $$f'(x) &gt; f(x)$$ for all $x$. Only examples I could think of were $e^x - c$ and simply $- c$ in which $c &gt; 0$. Also, is there any significance in a function that is always less than its derivative?    Edit: Thank you very much for all the replies. It seems almost all functions that apply are exponential by nature...  Are there more examples like - 1/x?  Again are there any applications/physical manifestations of these functions? [for example an object with a velocity that is always greater than its position/acceleration  is always greater than its velocity] How can you find and replace text in a file using the Windows command-line environment? Electorate badge rules? I just got the  badge on StackOverflow, which is nice, but I noticed a number of top users aren't yet listed (inluding Jon Skeet and Marc Gravell, who would certainly qualify).  This made me wonder how the badges are retrospectively applied. Is it just that the display is heavily cached and the badge is awarded when the user logs in again or something? Checking for a null int value from a Java ResultSet Tokenizing strings in C I have been trying to tokenize a string using SPACE as delimiter but it doesn't work. Does any one have suggestion on why it doesn't work?  Edit: tokenizing using:  strtok(string, " ");   The code is like the following  pch = strtok (str," "); while (pch != NULL) {   printf ("%s\n",pch);   pch = strtok (NULL, " "); } How do I prove this using question using Cauchy-Schwarz inequality? Prove that $\left | \frac{a-b}{a+b}+\frac{b-c}{b+c}+\frac{c-a}{c+a} \right | < \frac{1}{8}.$ Let $a,b,$ and $c$ be the lengths of the sides of a triangle. Prove that $$\left | \dfrac{a-b}{a+b}+\dfrac{b-c}{b+c}+\dfrac{c-a}{c+a} \right | &lt; \dfrac{1}{8}.$$   The best idea I had was to expand the fractions to get something nicer. So we get $\dfrac{a-b}{a+b}+\dfrac{b-c}{b+c}+\dfrac{c-a}{c+a} = \dfrac{a^2 b-a^2 c-a b^2+a c^2+b^2 c-b c^2}{(a+b) (a+c) (b+c)}.$ Then I would try to relate this to side lengths of a triangle to prove the desired inequality but that is the step where I am unsure. Why would spacetime curvature cause gravity? Vote for Tag Synonyms Directly on the Page Before:  After:   The pros:  Speeds up the tag synonym voting process. Easier to locate (as opposed to navigating to each individual tag wiki page). Encourages users to vote on more than one at a time.  The cons:  Serial up/downvoting. But this really isn't even an issue because, (1) only experienced users can vote on tag synonyms, and (2) more than one vote is required to approve a tag synonym, so the occasional serial up/downvoter won't significantly impact the overall process. Why do professional print houses use gamut-limiting CMYK? I recently had some business cards printed, and was warned to use the CMYK colour space if providing TIF files.  When I tried saving from Paint Shop Pro to a CMYK, of course the colours came out very much duller, so I provided a different file type that preserved my colours using RGB. To my horror, the cards came back nevertheless converted to the CMYK dull shades.    A few months previously I had been in a hurry and had printed my own one-sided quasi business cards using glossy photo paper and a cheap home printer.  This reproduced my desired colours perfectly.  Since the whole point of using professional printers is quality (though I admit bulk as well), why do they not use printers that can cope with the RGB colour range?   FYI: the main colour in question, which I chose very carefully, is a slightly yellow-tinged lawn green, which I understand doesn't feature in the CMYK gamut.  So why use that gamut, and is there anything I can do to overcome this issue and get cards printed in the colour I have chosen? How do you set, clear, and toggle a bit? How many sequences of $n$ tosses of a coin that do not contain two consecutive heads have tails as the first toss? If you toss a coin $n$ times, there are $2^n$ possible sequences of heads and tails. Let $E_n$ be the set of sequences which do NOT contain two consecutive heads and $e_n$, the number of sequences in $E_n$.  Thus $E_3$ $=$ $\{$ $TTT$, $TTH$, $THT$, $HTT$, $HTH$ $\}$ and $e_3$ $=$ $3$.  How many elements of $E_n$ have $T$ as the first toss?  Please can anyone help me out here? Can I visit UK with Italian stay permit? I'm an Egyptian citizen, who holds Schengen visa and stay permit in Italy. Can I go to UK for some days with my stay permit and Schengen visa? $\mathbb Q$ is not the direct product of two non-trivial groups. I know this has been asked before, in a bunch of places, so I expect it to be closed as a duplicate at some point, but I'd like to know if my own proof works. If the proof is incorrect, please limit answers to pointing out the errors. If the proof is correct, then thoughts on improving it would be appreciated.  Prove that $\Bbb Q$ is not the direct product of two non-trivial groups.  —Aluffi exercise II.3.5. My proof Suppose that $\Bbb Q = G \times H$, neither $G$ nor $H$ trivial. First note that $0_G$ is the only element of $G$ with finite order: If $m\ne 0$ and $m\cdot g=0_G$, then $m\cdot(g,0_H)=0_{G\times H}$, contradicting the fact that $\Bbb Q$ has no non-zero elements of finite order. Suppose that for some $m\ne 0$ and some $n\ne 0$, $\pi_G(m/n)=0_G$. Then $0_G=n\cdot\pi_G\left(\frac m n\right)=\pi_G\left(n\cdot\frac m n\right)=\pi_G(m)=m\cdot\pi_G(1)$. Since $\pi_G(1)$ has finite order, we conclude that $\pi_G(1)=0$. Since $\Bbb Z=\langle 1\rangle$, $\pi_G$ maps every integer to $0_G$. Now let $a$ and $b$ be non-zero integers. Then $b\cdot\pi_G\left(\frac a b\right)=\pi_G\left(b\cdot \frac a b\right)=\pi_G(a)=0_G$. As above, this shows that $\pi_G\left(\frac a b\right)=0_G$. Thus if $\pi_G$ is not an injective function, then it must map everything to $0_G$, so $G$ will be a trivial group. The same result holds for $\pi_H$. Since by assumption, $G$ and $H$ are non-trivial, $\pi_G$ and $\pi_H$ are both injective functions, which is of course impossible. Were these other people Chronicoms? We know that Enoch is a Chronicom, which is to say a sort of alien temporal observer.   When Enoch and his agents came and kidnapped       Coulson’s team,   for the purpose of sending them where they wanted; were these other agents also Chronicoms? I’m inclined to think they must have been (would Enoch have shared their advanced technology and goals, etc. with mere mortals), but on the other hand only one pod was mentioned. When there is a Personal Hotspot network available, it displays a chain link icon instead of the usual lock icon in the list of available networks on iOS and OS X.    My question is, how does OS X distinguish these networks? Is it specified in 802.11 how hotspots broadcast their SSID's differently?