What if my input is ";drop table giveaways;"?
Oh ninja'd :/
Comment has been collapsed.
I'm probably missing something here since my brain isn't wired for PHP these days, but isn't it impossible to tell what you're echoing if we know nothing about the database you're getting your data from?
Comment has been collapsed.
10 IF X = 42 GOTO 40
20 X = X + 1
30 GOTO 10
40 PRINT "X is finally 42!"
syntax error
:D
Comment has been collapsed.
Indeed. He should have recalibrated his function to forward the conductive resonation in sync with class inheritance. That would have catalysted the intrical parameters required to DDOS the prime value of the subatomic matrix. Simple looping any child could do.
Comment has been collapsed.
Assuming this is something like QBasic, he doesn't need to.
Comment has been collapsed.
require 'dbconnect.php';
/r/ dbconnect.php source
Comment has been collapsed.
Professional programmer with nearly a decade of experience in PHP here.
The code is using a deprecated module (mysql) and is very prone to SQL injection; it should be using prepared statements via either the mysqli or PDO modules.
The code is looking for a GET HTTP request where the input parameter is equal to the answer. So we'd need to set $_GET['input'] to the answer, of which could be any string whatsoever - there is no hint in the code as to what the answer is.
Alternatively, we could set $_GET['input'] to a certain string to SQL inject the database and dump the entire giveaway table.
The puzzle mentions using $a as a dummy string, but this is in no way applicable to any of the code, unless it confusingly is asking you to set $_GET['input'] to 'a' in order to get the answer, in which case it still makes very little sense and is worded quite poorly.
tl;dr This puzzle uses poor quality code and makes no sense.
Comment has been collapsed.
It actually was the same for me - code made no sense at all, but when I see discussions in this thread I clearly understand that I've missed somthing in this life and I've no puzzle thinking :)
Comment has been collapsed.
You don't seem to get the solution to this puzzle. I do, but there are still several possibilities to make the if-clause true and everyone of those can be written differently (depending on personal coding preferences). It's like free text, and free text is never a good response to a question that is based on simple string comparison (like itstoohard-puzzles)
Comment has been collapsed.
I tried a few working possibilities, but without knowing which exact approach the creator had in mind (and how he usually formats his code) i won't try again. Too much brute force
Comment has been collapsed.
You don't seem to get the solution to this puzzle. I do
Judging from the number of people who've solved it, you're the only one.
Comment has been collapsed.
its been less than an hour and this is an oddly specific question, i think 1 is pretty good
Comment has been collapsed.
Nice idea but It's hard to get the same syntax that you want. There are several ways to get the same result... it'd be better to use a real server running this php so we can get the link by ourself instead of trying to guess what syntax was the one that you wrote down as correct answer.
Comment has been collapsed.
As a professional web application developer with nearly 10 years of experience in PHP, I tend to agree with you. The language is incredibly terribly designed, but it is very viable for both small and massive applications alike. If you want to learn programming, don't learn PHP. If you must learn PHP, first learn another programming language, so you have some idea of why PHP is so terrible.
I've participated in PHP's language design mailing lists, i.e. the people who work on new features and what-not, and the language isn't going to get better. It's just a clusterfuck of bad design.
Personally, I recommend node.js. It's new and not as popular as other choices, but it's an incredible piece of software that has a lot of promise.
If you just want to learn programming, start with C. Not C++, not C#, C.
Comment has been collapsed.
Even VB6 is "very viable". That doesn't make it any good and doesn't mean you should use it ;) PHP is a serious clusterf*ck made by people with no theoretical knowledge nor prior development experience. It truly is unfixable at this point.
I don't think C is a good starting point, simply because it has pointers, and unless you're going to do low-level development, you don't need them. JavaScript is neat, but the whole prototyping thing won't apply to other languages later. Some people swear by Python as a starting point, but I will recommend C# - simply because it's the most advanced language right now, and along with Java, an industry standard.
Comment has been collapsed.
VB6 is not viable in the sense that PHP is. With PHP, you can easily create a simple or complex website, whether you're a single 14 year old or a professional company of thousands. The application can be designed so that it's easily maintainable. With proper caching and database design, speed is not an issue. PHP is a perfectly fine choice for any level of web developer, aside from the fact that the language itself is terribly designed.
C is a great starting point if you want to learn programming. By learning the basics early on, you'll have a much easier time with higher-level programming languages, and you'll have a better understanding of programming in general.
JavaScript is a great programming language, and the more you use it, the more you'll love it. Coming from a background in primarily classical object oriented languages, numerous parts of JavaScript were hard for me to grasp initially. The more I use it, the more I love it. It's incredibly flexible.
Python and C# are great languages all-together, though they're high-level and thus they wouldn't be my first recommendation to someone with no prior programming experience. Java is fine for the most part, but I often see Java developers tending to over-use object-oriented design in their applications, Java and not, and that's never a good thing. This is something I see more in Java developers than developers on any other programming language, so I assume it has something to do with the design of either the language or popular libraries/apps.
Rather than unlearning bad practices, learn the good ones first.
Comment has been collapsed.
You just try finding a client who would ask of you writing, or maintaining, his website using perl, python or ruby. I have yet to meet one. And absolutely no-one I've worked with ever had mod_perl, mod_python or Rails installed on the server, so you also can try persuading them into changing that.
All in all, the sad truth is that if you are a contractor, you simply need to know and work with that godawful language well enough to circumvent at least some of its godawfulness. I wouldn't even call PHP a language, it's more of a toolbox -- I guess when you don't call it a language in the first place, you can somewhat mitigate its messing with your brain.
Comment has been collapsed.
RoR was quite popular several years ago; I have no idea what happened to it since. Wouldn't surprise me if most of the stuff had been rewritten in something else.
I spent three years doing PHP, then had a short Joomla-PHP gig a couple of years ago. If I had to do it again, I'd probably jump off a bridge. Some things just aren't worth the money...
Comment has been collapsed.
RoR is still quite popular. Many large and popular websites are built using it.
Comment has been collapsed.
If you have any source for the VB6 statistics, I'd be interested in seeing them. I'm talking about enterprise web applications here. I have not heard nor, after brief research, do I see any numbers on modern-day VB6 popularity in regards to web applications or otherwise. I do find that quite intriguing, and would love to see some relevant data here.
Using quality, proper object oriented design, PHP applications can be around as easily maintainable as any application designed with any other object oriented programming language.
Comment has been collapsed.
[EDIT] Derp, never mind. I need to learn to read.
Comment has been collapsed.
I was expecting to find some complex code in Assembler, or a nice riddle in C++.
D:
Comment has been collapsed.
Bump
Code/Answer combination was wrong! I contacted OP and the code is now fixed! Try it again ;)
Comment has been collapsed.
i still have no idea how 5 people managed to get the same wrong answer as me
Comment has been collapsed.
Well, props to the people that found out what we're looking for.
Comment has been collapsed.
FORTRAN, floating point, BASIC, PASCAL, ... I don't think you guys even consider these programming languages, anymore. I've got nothing for this giveaway.
Comment has been collapsed.
36 Comments - Last post 2 minutes ago by Chris76de
1,962 Comments - Last post 57 minutes ago by MeguminShiro
15 Comments - Last post 2 hours ago by dingbat
21 Comments - Last post 2 hours ago by Mitsukuni
161 Comments - Last post 5 hours ago by wigglenose
1,042 Comments - Last post 13 hours ago by sensualshakti
769 Comments - Last post 14 hours ago by OwieczkaDollyv21
30 Comments - Last post 40 seconds ago by pizzahut
2 Comments - Last post 8 minutes ago by PossiblePsycho
6,349 Comments - Last post 21 minutes ago by Oppenh4imer
1,335 Comments - Last post 24 minutes ago by Vasharal
44 Comments - Last post 48 minutes ago by AmanoTC
16 Comments - Last post 50 minutes ago by AmanoTC
27 Comments - Last post 58 minutes ago by wigglenose
Nah just kidding but heres a shitty programming quiz for all you software engineers
Prize: ???
CV: $30.01
End: 7/5/2013 12:01AM (4 hours left from last edit)
http://itstoohard.com/puzzle/Lx76mz14
v1.0 - Original
v1.01 - Added More Choices
v1.02 Final - Fixed Syntax Issues
Usual rules apply, don't give out answers or hints.
Comment has been collapsed.