a friend of mine told me that using this script to authenticate users is real risk to sql vulns  &lt;?php if(strlen(strstr($_SERVER['HTTP_USER_AGENT'],"-- IPB Vaidation  --")) &lt;= 0 ){  die('Login Failed!, Please try again.'); } $name = strtolower($_GET["name"]); $password = $_GET["password"]; $digits = $_GET["digits"]; $random_number = 70;  $sum_total2 = $digits * $random_number; $con = mysql_connect("127.0.0.1","usernamehere","passhere"); if (!$con)   {   die('Could not connect: ' . mysql_error());   } mysql_select_db("database here", $con); $sql = "SELECT * FROM ipbmembers WHERE members_seo_name='{$name}'"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result))   {   $trueHash = $row['members_pass_hash'];   $salt = $row['members_pass_salt'];   } $hash = md5(md5($salt) . md5($password)); if($hash == $trueHash) { echo "Thank you for logging in"; echo ($sum_total2); } else { echo "Login Failed!, Please try again."; echo ($sum_total2); }   ?&gt;   can anyone show me how its done? or what iam doing wrong?      Thanks!
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?
After migrating 2007 to 2010- when i open the web application empty team site is created. no datas are visible I have followed this link for migrating SharePoint 2007 to 2010:    When navigating to my site after migration only the empty team site is visible. None of the data is available. Visual upgrade option is not there.  Where am I going wrong? Arranging GUI elements in QGIS 3 processing model user interface Using QGIS 3 graphical modeler I created a model with a variety of input parameters (> 10). When starting the model, a nice user interface is generated. But the arrangement of the GUI elements is totally confused and apparently unpredictable during creating the model. It does neither seem to depend on the arrangement of input parameters in the graphical modeler nor on the chronological order in which the input parameters are added to the model.   Is there a way that let's me arrange the GUI elements in the order I desire? Multivariate polynomial with no mixed terms Installing Wine on 64 Bit I have tried to install wine through the software center and terminal and I get this error.  chris@ubuntu:~$ sudo apt-get install wine1.5 [sudo] password for chris:  Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  wine1.5 : Depends: wine1.5-i386 (= 1.5.16-0ubuntu1) but it is not installable            Recommends: gnome-exe-thumbnailer but it is not going to be installed or                        kde-runtime but it is not going to be installed            Recommends: ttf-droid            Recommends: ttf-mscorefonts-installer but it is not going to be installed            Recommends: ttf-umefont but it is not going to be installed            Recommends: ttf-unfonts-core but it is not going to be installed            Recommends: winbind but it is not going to be installed            Recommends: winetricks but it is not going to be installed E: Unable to correct problems, you have held broken packages. How do you protect a camera and lens while photographing in rain or snow? I've been trying to photograph lightning lately, as we have had some great storms in Colorado. I've had some difficulty getting a good vantage point, however, as almost all of these storms include rain as well. To keep my camera from getting drenched (I have weather-sealed lenses, but my camera body, a Canon 450D, is not weather sealed as far as I can tell), I've had to shoot under the eve of a building or under a thick canopy of trees, however that has greatly limited my ability to adapt to the changing weather and get get a vantage point on the best lightning.  Is there any equipment, something I can purchase or something home-made that has easy-to-find parts, that can help me protect my lens from the rain while still being able to shoot? Additionally, I've been getting rain on a UV filter I have on the front of my lenses, simply to prevent rain from getting on the front lens element itself. However, once a storm really gets going, so does the rain. Is there a simple solution to keep rain off the front of the lens? Given an alphabet of size $n$, how many strings of length $c$ contain every single letter of the alphabet at least once?  I first attempted to use a recurrence relation to work it out:  $$ T(c) = \left\{ \begin{array}{cr} 0 &amp;\mbox{ if $c&lt;n$} \\ n! &amp;\mbox{ if $c = n$} \\ T(c-1) \cdot n \cdot c &amp;\mbox{ if $c &gt; n$} \end{array} \right. $$  As there's no strings that contain every letter if c &lt; n, and if c = n then it's just all permutations. When c > n you can take any string of size (c-1) that contains all letters (of which there are $T(c-1)$ to choose from), you choose which letter to add (of which there are $n$ choices) and there are $c$ different positions to put it. However, this gives out results that are larger than $n^c$ (the total number of strings), so it can't be right, and I realised it was because you could count some strings multiple times, as you can make them taking different inserting steps.   Then I thought about being simpler: you choose n positions in the string, put each letter of the alphabet in one of those positions, then let the rest of the string be anything:  $$ {c\choose{n}} \cdot n! \cdot n^{c-n} $$  But again this counts strings multiple times.  I've also considered using multinomial coefficients, but as we don't know how many times each letter appears in the string it seems unlikely they would be much help. I've also tried several other methods, some complicated and some simple, but none of them seem to work.  How would you go about working out a formula for this? I'm sure there's something simple that I'm missing. What is the proper way to change the DNS IP? I suspect that the name server provided by my ADSL modem/router is buggy. Whenever I browse to a website for the first time in ubuntu, resolving the domain name takes at least 15 seconds.  To work around that problem, I changed the nameserver configuration in /etc/resolv.conf from 192.168.1.1 (my ADSL modem) to 8.8.8.8 (google's primary DNS). This seems to fix the problem, but unfortunately my changes to /etc/resolv.conf are overwritten by "NetworkManager" at each startup.  What is the proper way to configure the name server IP in ubuntu 10.4? Sam developed an annual sweepstakes promotion entitled “The Free Gas Punt Return Game”.    Do I need a comma after entitled or not? "All X" vs. "all of X" vs. "all the X" Is there any difference between "all X", "all of the X", "all the X"? E.g.,        all friends   all of the friends   all the friends Proof of the following inequality $ \frac{x - y}{\log x - \log y} > \sqrt{xy} $, $x>y$. I have seen the following inequality  $$ \frac{x - y}{\log x - \log y} &gt; \sqrt{xy} \ , \quad \forall x&gt;y $$ be stated as a near "obvious" fact in another , on the site.  The inequality is very cute, but so far I have not been able to prove it.  It reminds me of the Lipschitz inequality, but has some minor differences. Also Jensens inequality comes to mind. Is there something obvious I am missing, or is this ineqality not as easy to prove as it looks? The API Sandbox This is the same concept as .  Why do we need more than one? this is in order to test the API, some methods support vectored ids (for example /questions/id1;id2/comments) and for that two sandboxes are needed. What makes some laser beams visible and other laser beams invisible? What makes the beam of some lasers:    visible?  such as the ones used in clubs or such as the laser pointers sold at amazon which if pointed to the sky look like a solid visible beam of light crossing the sky (it reminds me of the lightsaber in Star Wars). invisible?  such as the ones used in pointers for presentations. Getting incorrect slope values from an ASTER DEM in QGIS? I have a DEM layer from ASTER satellite and I want to get the slope information from it.  I use terrain analysis > slope, but the output is so wrong. Why is that?  Here is the DEM:     And here is the "Slope" that is totally wrong. It should stretch the values from 0 - 89.9097 but it does not. What really causes light/photons to appear slower in media? I know that if we solve the Maxwell equation, we will end up with the phase velocity of light being related to the permeability and the permittivity of the material. But this is not what I'm interested in - I want to go deeper than that. We know that the real speed of light is actually not changing, the decrease in speed is just apparent. Material is mostly empty, the light will still travel with $c$ in the spacing. The rare atoms will disturb the light in some way. So I am interested in how the atoms affect the light. Photon absorption-emission theory Some textbooks that I read explain it in a way kind of like this: In a material the photons are absorbed by atom and then re-emitted a short time later, then they travel a short distance to the next atom and get absorbed&amp;emitted again and so on. How quickly the atoms in a material can absorb and re-emit the photon and how dense the atoms decides the apparent speed of light in that material. So the light appears slower because it has a smaller “drift speed”. Interference theory But recently I realize an alternative explanation: Atoms respond to the light by radiating electromagnetic wave. This “new light” interferes with the “old light” in some way that results in delayed light (advanced in phase), this can easily be shown by using simple phasor diagram. Consequently effectively the light covers a smaller phase each second, which gives the impression of a lower phase velocity. However the group velocity is changing in a complicated way. I think that the first explanation does not explain the change in phase velocity of light. if we consider light travelling into a slab of negative refractive index non-dispersive material, let’s say the light is directed perpendicular to the slab. The phase velocity’s direction will be flipped, but group velocity’s direction in the material will not change. Only the second explanation can explain the flipped phase velocity direction. I guess that the velocity that we get in the first explanation is actually belongs to the group velocity. It makes sense to me that the front most of the photon stream determines the first information that the light delivers. So the question is What really cause the phase velocity of light to be decreased?  &quot;drift velocity&quot; of photons (they aren't the same photons, they are re-emitted all the time) phase difference between absorbed and emitted light something else  And also, I still don't really understand detailed explanation of the absorption-emission process for small light's wavelength (for large lambda compare to the atoms spacing, the photons will be absorbed by the phonons). The dispersion relation that we know is continuous and also some material is non-dispersive, therefore the absorption process must occur in all frequency for a certain range. So definitely it doesn't involve the atomic transition, otherwise it will be quantized. My guess is that the relevant absorption process gets smooth out by the dipole moment. What makes the spectrum continuous? EDIT: link for dispersion relation: I am downloading the HTML source page of a website using cURL command. The problem is, I do not want most of the contents in the page. I just need the first 100 lines of the source page. Is there a way to stop the download of the page after first few lines?  Currently, I have the below command working but it does not seem to be time effective.   curl -r[0-1] "http://www.freebase.com/m/045c7b" &gt; foo.txt   I tried changing the value from 1 to .5 and .05 and still the entire web page is getting downloaded.   I am looking at time less than a second to execute the above command.    EDIT  From the man page of cURL, I see that "You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, you'll instead get the whole document." So if the server is not supporting the range querying, is there some other command in nix environment which will help me accomplishing what am trying to do? Miktex Package Installation I recently installed MiKTeX with the texmaker editor and cannot figure out how to update the packages. When I attempt to use the subfigure package with the following preamble  \documentclass[a4paper,12pt]{article} \usepackage[english]{babel} \usepackage{graphicx} \usepackage{subfigure}   I then get a prompt to install a new package, which I then set to the online directory at ctan. I then get the following error:   ! LaTeX Error: File `subfig.sty' not found.Type X to quit or &lt;RETURN&gt; to proceed,or enter new name. (Default extension: sty)Enter file name:! Emergency stop.&lt;read &gt;   How do I properly install packages to miktex? I'm absolutely confused. Thanks in advance for any help. I have a JavaScript object like the following:  var p = {     "p1": "value1",     "p2": "value2",     "p3": "value3" };   Now I want to loop through all p elements (p1, p2, p3...) And get their keys and values. How can I do that?  I can modify the JavaScript object if necessary. My ultimate goal is to loop through some key value pairs and if possible I want to avoid using eval. If H is a subgroup of a group G and K is a normal subgroup of G the show that K is a normal subgroup of HK. Note K is a normal subgroup of HK  I thought I could just prove K is a subset of HK and vice versa so as to prove it a normal subgroup but then how to do this I have no idea because I keep getting hk element again while trying to do so.  I just tried to implement the steps to find HK is a subgroup of G. Can I still use logistic regression if some variables are not applied to all the observational units? Some of the variables are questions that are not being asked to every single person in the questionaire depending on how they answered previous question(s). So would I still be able to use a logistic regression if some of the questions (the independent variables) are only measuring the responses of SOME of the respondents? I've been reading the  and it mentions about virtual terminals which, if I understood it correctly, it is a Linux-specific feature (not in Unix) to allow multiple login consoles in a non X11 system. You create virtual terminals by pressing ALT-F2. I'm running Linux Mint and in my /dev folder though I see many tty devices and I don't know what they are for. Here is the grepped output:  crw-rw-rw-  1 root tty       5,   0 Jan  2 19:45 tty crw--w----  1 root tty       4,   0 Jan  2 19:10 tty0 crw-rw----  1 root tty       4,   1 Jan  2 19:10 tty1 crw--w----  1 root tty       4,  10 Jan  2 19:10 tty10 crw--w----  1 root tty       4,  11 Jan  2 19:10 tty11 crw--w----  1 root tty       4,  12 Jan  2 19:10 tty12 crw--w----  1 root tty       4,  13 Jan  2 19:10 tty13 crw--w----  1 root tty       4,  14 Jan  2 19:10 tty14 crw--w----  1 root tty       4,  15 Jan  2 19:10 tty15 crw--w----  1 root tty       4,  16 Jan  2 19:10 tty16 crw--w----  1 root tty       4,  17 Jan  2 19:10 tty17 crw--w----  1 root tty       4,  18 Jan  2 19:10 tty18 crw--w----  1 root tty       4,  19 Jan  2 19:10 tty19 crw-rw----  1 root tty       4,   2 Jan  2 19:10 tty2 crw--w----  1 root tty       4,  20 Jan  2 19:10 tty20 crw--w----  1 root tty       4,  21 Jan  2 19:10 tty21 crw--w----  1 root tty       4,  22 Jan  2 19:10 tty22 crw--w----  1 root tty       4,  23 Jan  2 19:10 tty23 crw--w----  1 root tty       4,  24 Jan  2 19:10 tty24 crw--w----  1 root tty       4,  25 Jan  2 19:10 tty25 crw--w----  1 root tty       4,  26 Jan  2 19:10 tty26 crw--w----  1 root tty       4,  27 Jan  2 19:10 tty27 crw--w----  1 root tty       4,  28 Jan  2 19:10 tty28 crw--w----  1 root tty       4,  29 Jan  2 19:10 tty29 crw-rw----  1 root tty       4,   3 Jan  2 19:10 tty3 crw--w----  1 root tty       4,  30 Jan  2 19:10 tty30 crw--w----  1 root tty       4,  31 Jan  2 19:10 tty31 crw--w----  1 root tty       4,  32 Jan  2 19:10 tty32 crw--w----  1 root tty       4,  33 Jan  2 19:10 tty33 crw--w----  1 root tty       4,  34 Jan  2 19:10 tty34 crw--w----  1 root tty       4,  35 Jan  2 19:10 tty35 crw--w----  1 root tty       4,  36 Jan  2 19:10 tty36 crw--w----  1 root tty       4,  37 Jan  2 19:10 tty37 crw--w----  1 root tty       4,  38 Jan  2 19:10 tty38 crw--w----  1 root tty       4,  39 Jan  2 19:10 tty39 crw-rw----  1 root tty       4,   4 Jan  2 19:10 tty4 crw--w----  1 root tty       4,  40 Jan  2 19:10 tty40 crw--w----  1 root tty       4,  41 Jan  2 19:10 tty41 crw--w----  1 root tty       4,  42 Jan  2 19:10 tty42 crw--w----  1 root tty       4,  43 Jan  2 19:10 tty43 crw--w----  1 root tty       4,  44 Jan  2 19:10 tty44 crw--w----  1 root tty       4,  45 Jan  2 19:10 tty45 crw--w----  1 root tty       4,  46 Jan  2 19:10 tty46 crw--w----  1 root tty       4,  47 Jan  2 19:10 tty47 crw--w----  1 root tty       4,  48 Jan  2 19:10 tty48 crw--w----  1 root tty       4,  49 Jan  2 19:10 tty49 crw-rw----  1 root tty       4,   5 Jan  2 19:10 tty5 crw--w----  1 root tty       4,  50 Jan  2 19:10 tty50 crw--w----  1 root tty       4,  51 Jan  2 19:10 tty51 crw--w----  1 root tty       4,  52 Jan  2 19:10 tty52 crw--w----  1 root tty       4,  53 Jan  2 19:10 tty53 crw--w----  1 root tty       4,  54 Jan  2 19:10 tty54 crw--w----  1 root tty       4,  55 Jan  2 19:10 tty55 crw--w----  1 root tty       4,  56 Jan  2 19:10 tty56 crw--w----  1 root tty       4,  57 Jan  2 19:10 tty57 crw--w----  1 root tty       4,  58 Jan  2 19:10 tty58 crw--w----  1 root tty       4,  59 Jan  2 19:10 tty59 crw-rw----  1 root tty       4,   6 Jan  2 19:10 tty6 crw--w----  1 root tty       4,  60 Jan  2 19:10 tty60 crw--w----  1 root tty       4,  61 Jan  2 19:10 tty61 crw--w----  1 root tty       4,  62 Jan  2 19:10 tty62 crw--w----  1 root tty       4,  63 Jan  2 19:10 tty63 crw--w----  1 root tty       4,   7 Jan  2 19:10 tty7 crw--w----  1 root tty       4,   8 Jan  2 19:10 tty8 crw--w----  1 root tty       4,   9 Jan  2 19:10 tty9