r/jquery • u/ChemTechGuy • Mar 26 '13
Asynchronous Database Operations with PHP and jQuery
http://alexdglover.com/asynchronous-database-operations-with-php-and-jquery/4
u/loodroomer Mar 27 '13
Backbone.js w/ Laravel or CodeIgniter would be the sane version of such a thing.
1
Mar 27 '13
I saw a backbone and laravel post, but havent found one on backbone and codeigniter, do you have one?
2
u/loodroomer Mar 27 '13
Here's one written by a really smart guy: http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2/
But at this point in time CI is falling out of favor with some, including Phil Sturgeon who wrote this article back in 2010. I think he would probably tell you to use Laravel over CI.
2
2
3
Mar 27 '13
Welcome to 2006? Do people seriously write code this bad still? Horrible. Zero security with the database and no abstraction or models.
3
u/maktouch Mar 27 '13
Good god, please take down the article or correct it. Your intentions are well but you're actually hurting the whole community by doing this.
Use Prepared Statements!
You're failing super basic security. SQL Injections everywhere!
$sql="INSERT INTO customer (Last_Name, First_Name, Phone_Number, Street_Address, City, State, Zip) VALUES ('$_POST[lastName]', '$_POST[firstName]', '$_POST[phoneNumber]', '$_POST[address]', '$_POST[city]', '$_POST[state]', '$_POST[zip]')";
That is so bad.
3
u/Disgruntled__Goat Mar 27 '13
That's what you get when you learn web dev from w3schools.
This comment is 100% correct, not sure why it's getting downvotes. Sure, maybe it's a little harsh but that's required - you can't put out code this bad onto the internet and expect people to be nice.
1
u/achuy Mar 27 '13
But it is good code when using w3schools or tizag as a starting point. In fact, it is brilliantly executed.
-8
5
u/ikeif Mar 27 '13
Everyone takin the time to criticize and tell him not to teach, yet no one comments on his site to help teach him...