Little background. I'm making a forum with an account system.  So naturally they have to insert data to the database whilist speaking in the forums.   What is the safest way to let the user input data in an textarea?   Is there away so they can't just type in DROP TABLE 'USERS', or something else that might effect my forum?  Now I know there is some solutions to this, but how can I do this so that they're able to make their text look nice (&lt;h1&gt;,&lt;img&gt;) etc, but not do a proper SQL query?  Kinda like this page is made, I can type here with all sorts of looks but I cannot do anything to harm the page.  Thanks.  -Kevin
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 have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.  I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax? Proper way to do "conditional segue" in iOS5 How can I draw a horizontal line spanning only some of the table cells? In a table, how can I draw a horizontal line that goes only through some of the cells? I mean a line like the one in the Foo and in the Bar area of this table:  +----+-----+ |Foo |1 |2 | |    |1 |2 | |    +--+--+ |    |1 |2 | |    |1 |2 | +----+-----+ |Bar |1 |2 | |    |1 |2 | |    +--+--+ |    |1 |2 | |    |1 |2 | +----+--+--+ Suppose $p$  and $p^2+2$ are prime numbers, prove that $p^3+2$ is also a prime number. Actually I do not know what is the relationship among square numbers, cube numbers and prime numbers Sending email in .NET through Gmail Instead of relying on my host to send an email, I was thinking of sending the email messages using my Gmail account. The emails are personalized emails to the bands I play on my show.   Is it possible to do it? I've downloaded ubuntu-12.04.1-desktop-amd64.iso via Chrome. Once that was done, I wanted to burn it onto a CD but I can't find the .iso file.   When I opened the Downloads folder, the .iso extension is not there anymore, and it opens with WinRAR for unzipping. I tried unzipping and searching for any ISO files but no luck.   I'm trying to add Ubuntu onto VirtualBox on Windows 7 host OS. Please help. Doing bad in undergraduate but good in a masters program Suppose you do bad in undergraduate school in say computer science. But you do very well in a masters program in computer science. If you want to apply to a PhD program in computer science, will the masters degree grades offset the undergraduate degree grades? $\left|x_{n+1} - x_n\right| < C\left|x_n - x_{n-1}\right|$ prove this is Cauchy I have a problem with a virus in windows 7, I don't know what kind of virus is infected my OS, I installed kasersky antivirus, and clear all detected viruses. After that I can't open any antivirus sites, can't ping any antivirus sites. example:  C:\Windows\system32&gt;ping kaspersky.com Pinging kaspersky.com [38.117.98.231] with 32 bytes of data: General failure. General failure. General failure. General failure.  Ping statistics for 38.117.98.231:     Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),   When I ping to other sites, I get reply normally: example woth pinging to google.com  C:\Windows\system32&gt;ping google.com  Pinging google.com [31.7.160.224] with 32 bytes of data: Reply from 31.7.160.224: bytes=32 time=2ms TTL=61 Reply from 31.7.160.224: bytes=32 time=2ms TTL=61 Reply from 31.7.160.224: bytes=32 time=1ms TTL=61 Reply from 31.7.160.224: bytes=32 time=1ms TTL=61  Ping statistics for 31.7.160.224:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:     Minimum = 1ms, Maximum = 2ms, Average = 1ms   I tryed any antispyware/antimalware softwares, but null results.  Anyone else encountered this problem? Why is there such variation in PhD length internationally? I'm an undergrad in Australia, and at this stage I want to go on to do further study in maths (or maybe physics/CS, still have a few years till then).  Should I do so, I imagine that I will want to complete a PhD overseas. Possibly at a university in the US or maybe Oxbridge in the UK.  In Australia, PhDs typically take 3 or 4 years, and I would be eligible to go straight into a PhD upon completion of my undergraduate degree (it is research focused and includes an honours year, see ).  But, much of what I have found for overseas institutions has been in the range of 5-7 years, or maybe a 3-4 year PhD with a few years doing a master's degree beforehand.  Does this indicate that the level of rigour and amount of work produced is significantly different for various PhD programs, or is it the case that some programs are more relaxed and simply spread the same amount of work over a longer period of time? Install Ubuntu, you can not continue Should I test private methods or only public ones? English version of Ubuntu with Italian keyboard I want to install Ubuntu in ENGLISH (UK) but I have an ITALIAN keyboard, which has a different layout to the English keyboard. How can I install Ubuntu in English but select an Italian layout for the keyboard. I tried, but it would only allow me to select an English keyboard. Thanks I'm trying to send an E-mail message using Gmail to a contact group where some of the contacts have more than one E-mail address and I want to send the mail to all of them.   Is there a way for me to do that? 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. I have a dll that was written in c++, I need to use this dll in my c# code. After searching I found that using P/Invoke would give me access to the function I need, but these functions are defined with in a class and use non-static private member variables. So I need to be able to create an instance of this class to properly use the functions. How can I gain access to this class so that I can create an instance? I have been unable to find a way to do this.   I guess I should note that the c++ dll is not my code. Reverse (parse the output) of Arrays.toString(int[]) Does every number not ending with zero have a multiple without zero digits at all?   We consider numbers in their usual base 10 representation. we don't consider numbers ending with $0$, because all multiples of such numbers end with $0$.   It can be proven that all powers of $2$ have such a multiple: Indeed, for every number of the form $2^n$, we can find a multiple $l$ of it whose last $n$ digits are nonzero (This can be done by repeatedly multiplying a number by $10^k+1$, as explained ), and then forget all other digits; these last $n$ digits constitute a number that is still divisible by $2^n$, since it is obtained from $l$ by subtracting a multiple of $10^n$ which is in particular a multiple of $2^n$.  The same argument shows that every power of $5$ has a multiple without zeros, but this does not seem to generalize to other numbers.  My intuition is actually that the claim is not true, since the density of numbers without any zero digits approaches $0$ for big numbers. This is because the probability of a random number with at most $n$ digits to contain only nonzero digits is $(\frac{9}{10})^n$. Thus big numbers "nearly always" contain a zero. This hints on the existence of a counterexample, but does not prove its existence. Why no ooVoo on ubuntu? How do I get a consistent byte representation of strings in C# without manually specifying an encoding?