« first day (879 days earlier)      last day (4287 days later) » 

00:05
Right, I'm being exceptionally softcore this evening and bailing at the exceptionally softcore time of 00:05
Night @all
-9
Q: Does PHP far_t?

user2163165Why do the nerds of this web site shut down questions and accounts as if they know sh1t ?

^^^ delete pls
Hi All
00:34
Just throwing this here. Let's discuss.
@Jueecy thanks, I was hoping someone would post a screen. I don't have rep to see the deleted Qs
01:03
Very funny is it a real question?
I find it sexist
Hi, I am using update query in php like this: ` $sqlRequest = "update wp_customer set gender = '".$gender."',salutations = '".$salutations."',first_name = '".$first_name."',last_name = '".$last_name."', email = '".$email."', address = '".$address."',city = '".$city."',province_state = '".$province_state."',country = '".$country."',postal_code = '".$postal_code."',phoneno = '".$phoneno."',notes = '".$notes."',credit_amount = '".$credit_amount."' where id='".$id."'";
$result = mysql_query($sqldup);
However, $result value is always -1
@GarouDan, it was
@Malloc, post a question. This is no help desk
huhu
@Jueecy Update request return -1 so It fails to update in DATABASE. mysql_affected_rows() return -1
01:07
@Malloc, I think you should take a look in PDO (php.net/manual/en/book.pdo.php).
I don't want to use PDO for my context, is there anyway to do with mysql_query, since Select query works fine.
Well, the best way to know if the SQL is ok is print it and run on a client, like Sequel, for example. Did you do this?
@malloc even if you don't want to learn pdo, you should probably at least make arrays of properties and values, then merge them, so you can prevent silly typos from causing errors
You right
but it would make your life a whole lot easier if you made a class for wp_customer
user895378
01:17
@Jueecy Nobody cares because we aren't 12 years old.
user895378
The flag/close/delete system works. Imagine that.
@rdlowrey, ehm... that was a joke.
aw man, i was hoping for a flame war
user895378
user895378
@Jueecy In that case, enjoy the above :)
01:22
@Malloc why not?
user895378
It's a really nice feeling when you go off on a really far-ranging, experimental refactoring tangent and end up with something that works AND passes all your existing tests.
@ircmaxell I am stacking with a huge project, the code is old and I am maintaining it for urgent modifications. Once I get time to refactor the code for PDO support I will do
@rdlowrey does sound nice
@rdlowrey 4www sh1t b1tch b3 tr1ipp1n =oP
user895378
@crypticツ Ooh, looks like @DaveRandom added the Urban Dictionary plugin to the bot :)
01:27
@rdlowrey Woot!
user895378
@ircmaxell In a related note, when I said "something that works," apparently I really meant "something with phantom errors that I can't find that have eluded my test suite."
user895378
good feelings officially rescinded :(
user895378
Although finding a hole in your tests is never a bad thing, either.
lol
Is it weird that I have dual monitors setup on the same screen to different inputs?
user895378
I think my brain just recursively exploded trying to understand @ircmaxell's monitor configuration.
01:32
I have a 47" TV connected via both HDMI and VGA to the computer
user895378
ohhh.
user895378
I've officially started the countdown. Game of Thrones season 3 in T-minus 19 days.
user895378
And this year I won't be pirating it as soon as the original airing ends because I'm actually paying for HBO these days :)
@rdlowrey stahp!
@ircmaxell so your TV has a split screen? or you change the input to view the other screen?
01:36
No, change input
actually, I wonder... Let me do PIP
@rdlowrey ............paying for HBO? people do that?
@Lusitanian I'd pay for such services too if it wasn't that <germany>
@Lusitanian richies
01:57
0
Q: PDO update failed

MallocMy iPhone app is communicating with a PHP API, each time I try to use PDO for update statement, I got this error on my iPhone application error: "Expected status code in (200-299), got 500"; PHP relevat code is the following: $id = $_REQUEST['cid']; $gender ...

Good morning. I have arrived...at work.
where?
7pm over here
user895378
@Lusitanian I don't know, man. I've seen the light. HBO-Go is awesome.
in the east
02:32
What is the best way to avoid MySQL injection through PHP?
@andho ?
@BrandonGelfand Have you asked Google?
I believe there's a question with exactly that title ... well, minus the @andho of course ;-)
In database management systems, a prepared statement or parameterized statement is a feature used to execute the same or similar database statements repeatedly with high efficiency. Typically used with SQL statements such as queries or updates, the prepared statement takes the form of a template into which certain constant values are substituted during each execution. The typical workflow of using a prepared statement is as follows: # Prepare: The statement template is created by the application and sent to the database management system (DBMS). Certain values are left unspecified, called...
Yes, I have found a lot of different answers though
@BrandonGelfand Go for the one with the most votes :)
rule of thumb
@Jack agree with me here for the love of shit
02:35
Ok, how do I do a prepared statement?
for the love of community please!!
@BrandonGelfand use PDO. If that's too confusing, use mysqli with parameters.
The best way to prevent sql injections is of course to not use sql in the first place ;-)
Cant do lite
just type mysqli prepared statement
02:36
i am using wordpress atm.....
and am afraid of MySQL injection
Lo' and behold, Gordon has a beautiful diamond next to his name, long live Gordon! :)
el moderatore'
yeah, you should probably find someone locally who can sit with you and help you. Unless your site has important information, wordpress probably does an ok job
02:37
hehe
don't know for sure
@andho I dont think I can change up the database though because its wordpress
@BrandonGelfand they like making unhelpful comments like that. Ignore architecture change comments
$mysqli = new mysqli(host, username, password, database);
if ($stmt = $mysqli ->prepare("INSERT INTO Blah (User) VALUES(?)") {

$stmt -> bind_param('s', $username);
$stmt -> execute();
$mysqli -> close();
@BrandonGelfand
Where do i put ut?
it*
02:38
Preferably in it's own file, or include it all the way at the top of the file
Every file?
What are you trying to do?
block MySQL injection
s
Yeah but for what
Wordpress
02:39
Can mysqli be made to throw exceptions on sql errors? Just curious.
lol this is funny
why @hanleyhansen ??
The only time you have to worry about injections, is when you give the user an opportunity to submit to the database?
So any time you have a text field
or a $_GET
from the url
Would be where you want to use it
@BrandonGelfand go find a wordpress forum. I think you're ok, though. Unless you're using custom stuff that isn't widely used.
@XCritics Don't forget cookies and $_POST.
02:40
yeah that too
Avoid cookies use sessions unless you're using a remember me box
and certain fields in $_SERVER.
@Stephane do you use wordpress?
in that case gen a hash with salt and save it and assign it to the person
well work with it...
@BrandonGelfand just enter ':''""'""'" into every field you can on your site. If it breaks, then you have a problem. It's possible you have a problem even if quotes don't break the form, but it's less likely (not a security expert).
02:41
If you want to remain using your way the only safe way I could think of is

$blah = mysqli_real_escape_string(trim($_POST['blah']));
@XCritics hash and salt, wait what? what for?
@XCritics I don't think he knows where to look for this stuff
@Jack that's the way I use cookies if I need to set them
@Jack and assign the cookie to their remember_me token
@XCritics oh that ... why are you even hashing that for remember_me feature?
@Stephane do you do a lot with WP?
02:42
you don't need to worry about wordpress itself
are you doing something custom with wordpress?
I'm sure that by now at least the base of WP itself is relatively safe from sqli
@BrandonGelfand
I need a TCO
Yeah I was going to say I thought wordpress is built open source with security, like drupal
02:43
@BrandonGelfand not much. I've fixed some custom scripts that were breaking and helped move a couple sites, but not really.
@XCritics yeah, it's something you don't want to say but have to say it anyway even if you don't believe it
Anyone want to help a 14 yr old develop an amazing thing that has ventur capital backing?
or will when a working model is done...
venture*
crap I cant spell today......
@BrandonGelfand Who's the 14yr old? Ohh ...
@BrandonGelfand you're base is wordpress?
02:45
Yes
all ur base are belong to wordpress
@BrandonGelfand everyone has ideas, but they usually aren't workable. If you want to share a little bit of your idea without giving too much away I'm sure people would be willing to respond more.
@BrandonGelfand if you have venture capital backing why don't you hire real developers?
I was offered once I have a working model
02:45
He needs to build a prototype
exactly @Stephane
it's not that hard really, it's about pushing it
@BrandonGelfand so you don't have the backing yet.
It is very doable, it is basically mashing a lot of opensource together and making it all work smoothly, with only one really custom thing that is still pretty much done
@hanleyhansen no, I will have it once a working model is presented though
and there is proof of concept
What's the target industry?
02:48
Micro sites
but an enhanced version
extremely enhanced
I am working with envato
@BrandonGelfand this is a fallacy
and several other companies
you cannot mash opensource together and make it work smoothly
or mash anything together
It isnt all open source
it doesn't matter
02:49
it isnt really mashing things together
what are you trying to accomplish?
I termed that poorly
what even makes you concerned about sql injections?
adding more features to curently open source and enhancing it
hey there actually I have a question about wordpress i actually i am trying to post image but its not showing up front page its just showing title have anybody had this kind of experience then please help me :D
02:49
User security and privacy of an existing customer
Well, I'm happy to help you, but I doubt I'm interested in the business venture. Feel free to Skype me. Too many cooks in this kitchen stephane.deuvaert
gah, silly sqlite .. I was wondering why inserting 400 records was so slow .. turns out that it uses autocommit by default =/
@Stephane please dont take this wrong, but are you a boy or girl, does't matter to me, just curious I have seen stephane as a boy and girl
It's a french name: male.
thought so
k cool
i will add you
02:52
@Stephane are you sure lol :D
dont be an ass dude
@MalikUsman I worked at a school for 12 years doing multimedia. This is a cake walk.
@Stephane sent a request
Oh lol AS a teacher or student anyway if you dont mind then answer my question lol
hell everybody gone lol ;D
03:25
@gordon CONGRATULATIONS .... :)
03:35
for MySQL connection , you guys prefer PDO or MySQLi ? Prepared Statement / Non-Prepared Statement ?
@ShivanRaptor Generally prepared statements in PDO
but why ?
I know prepared statements are safer to SQL Injection , but the speed is slower , right ?
@ShivanRaptor It's easier to use different DB types with PDO, and if you use prepared statements you're less likely to forget to escape a value
@ShivanRaptor A bit slower, but normally that isn't an issue.
@webarto you added nginx as a skill
i lol'd
1
Q: C source code lexical parser in Java

MACI need a lexical parser that will parse C source codes and I have to do it using Java language. I researched for it and saw ANTLR and JAVACC. Which of these parsers are better to use and why? Or do you have any other parser to recommend? Answers will be much appreciated. Thanks.

03:51
but isn't it mysqli_real_escape_string() sufficient already ?
@ShivanRaptor Here's a good answer for that question stackoverflow.com/a/6367544/710827
Ha, I guess the only reason I stay away from PDO is that it requires PHP v5.3, which normally shared hosting doesn't provide such new version
@ShivanRaptor mine thankfully supports it
namespaces are the bomb diggity too
@ShivanRaptor PDO first shipped with PHP 5.1
right right, it's 5.1 ...
04:06
Shared hosting doesn't even support 5.3? dafuq?
my shared hosting uses 5.2.16
@ShivanRaptor ah that's almost not worth it.
5.2 is wild
low price, low quality , lol
04:32
can generators yield like so:
$listofstuff = array();
$listofstuff[] = keep_yielding_sequentially();
04:54
PHP has Type Hinting, what is the equivalent syntax called in Java?
@andho in Java , you HAVE to specify types you pass
It supports no form of type inference
@BenjaminGruenbaum yeah, i wanted to search if it's possible to use interfaces in this manner, but didn't know the word to use. Using type hinting returned php stuff. But it might be a problem in my interface definition
 
2 hours later…
06:44
Hey everyone!
Hi =)
good mornings
happy first moderator day @gordon
To begin with Im very new to php and mysql. The following code never connects to the database its just store it in a variable, is that correct? $conn = mysql_connect ($hostname, $username, $password) or
die(mysql_error());
07:03
mornings
@Sebastian As per my knowledge it gives a connection object of a database. It works like a handler with which you can do CRUD operations to the database which has the given credentials.
Yay! Congrats! @gordon
@Sebastian php.net/mysql_connect connects to the database and stores a link-identifier to the database. Visit the manual page of each function you make use of, it most often contains a lot of useful information.
@hakre OK thanks i got it to work now
07:27
@hakre Do the moderators chat, a crazy doubt ? :P Because I have never seen them chatting before.
@Sebastian , don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.
hii guys... is any1 available to discuss a php concept wid me?
only if you write using full words, instead of stupid abbreviations
okey..
thanks for answering though
i use a form on "page1" to transfer values to another page "page2".
Constraint: I cant use "action=form2" since all validation of form is on page1.
Hence i used $lastInsertedId = mysql_insert_id(); header('Location: page2.php?id='.$lastInsertedId);
this seems to be a recurring issue with transfering some form content from 1 page to another
the simple fact is, the concept is completely wrong
07:38
now when i transfer this to page2 via this method.. the url of page2 is like this
http://localhost/aaa/page2.php?id=16
wait.. first listen what i have to say..
then on page2 i have extracted values from database using this latest id.. and displayed the values.. there..
now if some user changes this url
localhost/aaa/page2.php?id=16 to some other id say 14 or 19.. it pulls out the data of that id and show it..
so i could not find any method of preventing it..
i m done now @tereško
@andho
ok
the problem is you are using a user provided value to search the database, so you're giving the user that power
instead you should hide that value from the user. conveniently you can do that using PHP sessions.
VSK
VSK
Hi
for this kind of one time things that is needed to be shared between just the next page, we call it a "flash variable"
VSK
VSK
0
Q: Magento vertical menu every page & Header menu navigation

VSKI am trying to customize header menu and vertical menu (left menu) in magneto cms the vertical menu is shown below but click on categories in the next page don't get categorys menu as shown below i am using below code on CMS -> Pages -> Homepage -> design->Layout Update XML <reference...

so, in short, store the last insert id in the session, then do the redirect with just localhost/aaa/page2.php and retrieve the id from the session and show the contents, and also remove the ID from the session
07:45
so you recommend doing it with php sessions
why i cannot see cv-pls question?
@Swati first transfer to first page than do whatever you want and than redirect to second page
whats the problem ?
@Swati probably yes. sounds like you want to use sessions. that was also my first impression when I quickly read your question.
07:47
@Swati it require 3k rep
ohh.. i am only 2963 short of it :D
@Swati and mysql_* function are deprecated please use either pdo or mysqli check this stackoverflow.com/questions/12859942/…
yes.. i know that also, but the thing is that... i m still using older php on my localhost
and those are deprecated in php version 5.5
i use 5.4.3
also.. is this statement correct?
@Swati yup :)
<input type="hidden" name="item1" value="<?php echo $var1; ?>" />
07:50
yeah, you can also display the data after saving in page1.php also. But if use refresh the page it will try to re-submit the data. To prevent this you can use a form token which gets invalidated when data is saved. too complex?
no this ^^
depends
yeah.. too complex.. i really do not care much about greatly to validations.. so simply i want to build this app so that it transfers the data and, thats all folks
however its correct
@Swati what ?
this
07:51
don't care about validation ?
@NullPointer <input type="hidden" name="item1" value="<?php echo $var1; ?>" />
that means.. there is nothing in the database, if user hacks and get control of that,, and can take away
@Swati i can only say there is not any syntax error
okey.. if there is no syntax error then it is okey
@Swati pardon i dont understand ?
@RenjithJR what is that ?
i want to say that, the database is not holding very important values, like emails, payment information, contact information etc... hence its not very sensitive
this link is for a online test he is going to conduct in india
07:55
@RenjithJR flag this .. this user is spamming
so basically this is a marketing strategy @NullPointer
@RenjithJR The reward is too low for Indians even.
@Appu: hmmmmmmmmm
yeah... thousand of students register with Rs. 100 and low winning amount
This reminds me of yesterday's requirement which was posted by the other guy.
Lol.
07:57
what?
Yesterday a guy posted the php requirement and the location is Chennai.
awsome
:D and he is looking for someone in chennai here..
@RenjithJR why u posted here ?
And some one said that the pay was too low.
@Appu isnt it called trolling :P
@RenjithJR blue background is really hurting my eyes

« first day (879 days earlier)      last day (4287 days later) »