« first day (1351 days earlier)      last day (3591 days later) » 
05:00 - 21:0021:00 - 22:00

5:42 AM
Oi fuck.
 
 
3 hours later…
9:05 AM
Mornings
And jolly weekend
 
9:42 AM
mornings
 
i have an issue with parsing .apk file..i am trying to fetch .apk file bundle name while uploading
anyone have experience in it ?
 
@Mark how are you doing that ?
 
iam using a 3rd party lib
it is working on same server in directory...but when i try to take this code to CODEIGNITER it gives me such a error "http://pastebin.com/igRfAevv"
i search all across the NET but not too much help over internet
Joe sir there?
 
Does anybody know a good place to buy php templates like for flash gaming sites and such things
 
@joe : this returns null i think
@ufoguy : mafiashare
 
10:23 AM
Hi
Any ideas what i'm doing wrong? pastebin.com/X7aKL5pH
 
Please check
1
Q: Wordpress query loop to get taxonomy based data

devoI have a newsletter subscription system based on category. I mean user can choose the categories for subscription (event-categories taxonomy). The post_type is subscriber and the post_title will be the user email.For subscribed users, the post_status will be subscribed. So what will be the best ...

 
mornings
room topic changed to PHP: Discussion for all things PHP, and stuff. Chat Guidelines : room-11.github.io [php]
 
10:59 AM
moin
 
11:30 AM
@JoeWatkins ping?
 
pong
 
Say I want to do a little bit of work on php-src for 5.7, should I do the same work against phpng as well?
(opinion, obv.)
 
I'd say focus on master/5.7, ng still has to have the 64bit stuff merged in before we can really work with it, since we don't want to write patches three times ... if you don't think you're going anywhere near stuff using sizes and other things 64bit effects then patch the branch for ng after 5.7 ... don't do anything weird *** and you'll have no problem patching for ng
 
Yeh I'm not sure if it will actually affect it, I'm just intrigued as to how these two rapidly diverging histories are going to be handled if/when it comes time to merge
 
@DaveRandom As master ist regularly merged into phpng, there are no rapidly diverging histories ;)
 
11:54 AM
Oh OK cool :-)
 
12:22 PM
Hi PHP kings.
0
Q: A more elegant and efficient way to update data

Hassan AlthafMy objective is to update necessary data using one function instead of having different functions to update different fields. So, I've created one and I think this is not really elegant, efficient or secure. I would seriously like a review if possible. Key. $data is an array. $data[0] =...

Checkout my post and suggest me improvements if possible.
 
morningi room 11
 
morning @PeeHaa
 
@HassanAlthaf Why are you closing the connection?
 
@PeeHaa cause the job is done?
 
ow wait. mysqli not the connection. The statement
 
12:25 PM
Yea/.
 
Arthough the same applies. The statement gets out of scope and is cleaned up right?
 
At least I hope it does that, because it would me stupid otherwise
 
Please review my code. :)
 
I just did
 
12:26 PM
The person who asked me to code this will fucking point out even a slightest mistake and insult me.
So, I want the code to be perfect and his eye-balls to pop-out of his skull.
 
Well sounds like a nice person for doing reveiews
 
No, he doesn't want to do a review, he wants to make fun of me.
He wants to put me down.
 
Also you potentionally allow people to inject anything in your query
 
Nope.
The $data[0] thingy is done automatically bro, where the function is called.
 
12:28 PM
I'm not your bro pal
 
Aren't we all from Adam and Eve?
So technically, everyone of us are brothers and sisters.'
Your statement was harsh.
 
Nope. I just told you:
2 mins ago, by PeeHaa
Also you potentionally allow people to inject anything in your query
And the answer was: nope. So what do you want me to tell you?
Fun fact: the answer on your question basically tells you the exact same thing
 
@HassanAlthaf you seem to have missed that info in your question
 
@RonniSkansing which
 
For anyone but you, that is open to sql injectin
you failed to mentioned that the specific offset already is sanitized and validated
Anyone trying to help with you code with see that as the biggest hole atm
 
12:34 PM
@HassanAlthaf NO
 
and also how about xss ?
 
@JoeWatkins what 'no'?
 
No adam and eve
 
@HassanAlthaf what if my display name is <script>alert('mailicious?')></script>
 
12:36 PM
Prep statements automatically do the shit
 
I can inject
 
I've tested.
 
oh you tested all cases there is to test?
 
Not allowed how? By telling them to pretty please not use a public API? — PeeHaa 4 mins ago
 
What.
 
12:37 PM
Prepared statements have nothing to do with XSS @HassanAlthaf
 
< is turned into &code;
-.-
 
and how does the browser read &code;?
nevermind
 
<HTML>&raquo;</HTML>
 
@HassanAlthaf Uhhmm yeah. That is not what prepared statements do
 
@Peeha then what?
 
12:39 PM
I was trying to help you...
But you are way too defensive
 
I know Ronni I will still add a sanitizing function, dw.
I'm ultra defensive.
I'm good in arguing right??
I should become a lawyer.
 
Well if this was a case about xss you would just have lost the case =]
 
Still XSS won't work in this.
 
In the case of the people v XSS the verdict is...
 
12:41 PM
@HassanAlthaf why not?
 
Isn't XSS done with JS?
 
@HassanAlthaf NO
that code is horrible
 
@JoeWatkins instead of moaning that the code is horrible, would you like to suggest how to make it better?
 
and it contains mistakes
 
@SecondRikudo it does. By making the update method public there is nothing stopping me from bypassing the validate method
 
12:44 PM
What do you mean Peeha
 
Only one developer has to forget to validate one time and your have a problem
 
sure, don't bother; choose your abstraction and use it properly, don't put layers of errors between you and your database, it's always pointless whatever ...
 
@PeeHaa But those methods still aren't available to the end user.
 
Morning
 
It doesn't affect SQL injection which comes from user input.
 
12:45 PM
developers introduce sqli not end users
 
moin
 
hey @Leri
BTW you might also want to use mb_strlen @HassanAlthaf
 
mb_strlen?
PHP Doc plz
 
no
 
c'mon php.net/name
 
12:47 PM
Also this:
   case 'rank':
        if(empty($data[1])) {
            $errors[] = "The rank field cannot be empty!";
        }
        if(count($errors > 0)) {
            return $errors;
        } else {
            return true;
        }
        break;
Should be:
       case 'rank':
            if(empty($data[1])) {
                return ["The rank field cannot be empty!"];
            }

            return true;
 
why array ?
why array with always one element ...
 
Why PeeHaa? I'm using an Array because I will be adding more validation checks.
 
wasteful
 
nuu nuu, I am gonna add more validation checks
 
so ?
 
12:49 PM
So there will be more elements that will get inflated in the array.
 
that array will never contain more than one element ...
that's wasteful
 
No, it will.
 
the other method has a mistake in it ...
all of it is pointless
 
I will be adding more stuff.
 
don't ask people to review what they cannot review ... and don't ask questions and argue with the answer based on nothing ...
 
12:51 PM
@HassanAlthaf No offense but.. if you know that you are doing it right, why do you ask advice? :)
 
@Leri Maybe there are better ways to obtain this goal?
 
@HassanAlthaf Well, what I've read so far people here are telling you those better ways, however you keep being "defensive" against them (for not reason, tbh) and reject what they say.
 
Dunno.
 
BTW, neither HTML not jQuery is programming language (referring to your profile).
 
lol ok.
Dunno if you will comment on my dick the next day.
 
12:57 PM
@HassanAlthaf Welcome in my tiny avatar list. :)
 
What do you mean.
 
I don't want to read that shit, conduct yourself properly, please ...
 
@HassanAlthaf it means he blocked you..
why are you so rude?
If you did not bloat up your qualifications you would not have to be so defensive
 
Stupid unit tests....always breaking my perfect code.
 
1:08 PM
:P
 
Magento is taking forever to install...
 
1:20 PM
@Leri It is but nothing to the suffering you wil experience once it has finished
 
@DaveRandom Not quite sure. It has just finished and I can't login to admin account. :D
 
Highly recommend you take that as a sign and go get drunk instead.
 
    if (!$cookieParams['httponly']) {
        unset($cookieParams['httponly']);
        if (!$cookieParams['secure']) {
            unset($cookieParams['secure']);
            if (!$cookieParams['domain']) {
                unset($cookieParams['domain']);
            }
        }
    }
mhm, I think I should follow signs. :D
 
@Leri WTF is that? :P
 
Ahoy hoy bro's and bro-ette's
 
1:36 PM
Yo @DanLugg
 
@PeeHaa The code that was invalidating my cookie domain. location: somewhere in the magento jungle. :D
 
wow
 
$hung = E_OVER
 
:-D Sign you are getting old
 
No, sign I drank/smoked too much
 
1:41 PM
:P
 
:-P
I should probably practice.
 
Yes you should :)
 
@DanLugg It's just the crack
 
2:38 PM
ok room 11. I am bored. What can I do? Preferably something I don't have to get out of my chair for
IT'S URGENT!
 
@PeeHaa Help me to install magento plugin. :D -_-
 
That is no fun!!!!
:p
Also: HOW HARD CAN IT POSSIBLY BE?????
:D
 
Seriously, I have reinstalled magento for the third time. For some unknown reason I can't login in admin after using connect manager. :D
 
What is connect manager?
 
Some thing that installs zipped plugins. It's the first time I actually looked into magento and I am like: I have no idea, what I am doing... oh, wait, wtf is this? :D
 
2:44 PM
:P
 
The universe is laughing at me: requires PHP version >= 5.2.13 and <= 5.4.0 current is: 5.5.9 :D
 
3:00 PM
Probably just a silly package maintainer
The chances of something not working in 5.5 that work in 5.4 are fairly small.
 
3:25 PM
@Leri < 5.4.0? WtF?
 
@ircmaxell Well, I am going to ask that to a plugin developer in a slightly polite way. :)
Honestly, I feel sorry for people who has to work with magento. It's been just few hours and I am already going nuts. :\
 
@Leri The really sad part is that there really isn't any alternative besides building it yourself
 
@PeeHaa Well, there're but either not in php or crap. :-)
 
The crap ones are not alternatives. What are the non php ones?
 
@PeeHaa nopcommerce.com Not fancy but easily extendable (I am rewriting some magento payment integration for it, atm) and broadleafcommerce.org I have not looked at its implementation yet, but looks good.
 
3:38 PM
@Leri What the hell requires < 5.4?
 
Oh, and forgot to mention, the first one is not mature yet. I.e. api can/will dramatically change in future so product becomes more powerful. However, that's just my guess.
@DaveRandom payment service integration lib. Close source, atm, afaik.
 
No PHP is closed source. How is is protected?
 
@DaveRandom Not public yet. LOL
 
There are very few things removed in 5.4, and none of those things should have been used in 5.3...
 
Hi
Whats wrong in this: 'SELECT * FROM users WHERE username = :username AND password = :password'
Im getting a wierd PDO error.
 
3:42 PM
morning
 
error messages usually help use to know what the problem might be...
 
I know I was just getting it for you :)
 
@Leri the nop admin looks pretty awful
 
$stmt->execute([
    'username' => $_POST['username'],
    'password' => $_POST['password'],
]);
You have to pass all the params into the query at once, you can't call it with a partial application of params...
 
I didn't realise I could do that.
Thanks @DaveRandom
 
3:45 PM
np
 
@DaveRandom is that login system i've made safe enough? Also im not sure I nailed this part either:
if ($_POST['username'] && $_POST['password'] = true) {
 
@DaveRandom Agreed. Honestly, I don't care much about that lib. It's outsource project they sent me that php library (with Dutch docs, unless I asked for English one) and I have to rewrite its functionality. /me is code translator :D
@PeeHaa Well, it does not look awful, it is awful. :D I liked it architecture-wise.
 
:)
 
@RahulKhosla no. you need to hash the password before you store it in the database, see password_hash()
 
@Leri Wait wut? Shit gets outsourced to my country now?
 
3:47 PM
@DaveRandom Password is pre stored, this is a login, im doing the registration later.
 
@PeeHaa No, shit things get outsourced from your country. :P
 
Yes, but the fact that you can do it directly with the value of $_POST['password'] tells me that the password is not hashed
 
:D
LOL!
A wild @Gordon in his natural habitat!
 
@RahulKhosla $bla = true will set $bla to true, even if it is inside an if, use === instead
 
@Patrick Thanks, but its now echoing error. Even when username and password are right.
if ($_POST['username'] && $_POST['password'] === true) {
echo "Logged in";
} else {
echo "Error";
}
 
3:51 PM
this doesn't make sense
at all
 
@RahulKhosla Google "PHP Operator Precedence"
 
@RahulKhosla If password is boolean, you have to rethink about your understanding of data types. :)
 
@RahulKhosla where do you store your username and password hash (it better be hashed...)? In a db?
 
Yes, not hashed yet :(
 
you need to search for the username in the db, fetch the password hash, then hash the password that was entered and compare the two hashes
so far so good?
 
3:53 PM
Yes.
I understand that now! :)
@Patrick 'SELECT * FROM users WHERE username = :username AND password = :password'.
'username' => $_POST['username'], 'password' => $_POST['password'],
I've got the first part, correct?
 
that should work on first glance, but now lets check the hash instead
 
@RahulKhosla why are you checking if the hash is === true? php.net/boolean
 
DB thing: What is the difference between Closure Table and Nested set Model (with right and left values) ?
 
Mybad, should I not be checking if they are true?
 
4:06 PM
@RahulKhosla why are you checking if the hash is === true? php.net/boolean
 
@Patrick Im really not sure, I tried = == ===
 
@RahulKhosla you are already checking if the password hash is true with your db query. so if you get a user back, password and username both matched. If you would have only looked up the username, then you would have to compare the password hashes (so formHash === dbHash). But in your case you don't need to do that, just check the user instead
 
Abit confused, what should I check the user against? The db user?
or db password?
 
actually, don't use execute here, you want to fetch the user row from the db
http://us3.php.net/manual/en/pdo.query.php
 
@Patrick $stmt = $db->fetch(
 
4:17 PM
@RahulKhosla ah, haven't used pdo in a bit... can you post your current code? paste.jesse-obrien.ca
 
you are setting $user here
$user = $_POST['username'];
 
Yes.
 
if you do == true, it will always return TRUE if there is anything in $_POST['username']
 
4:20 PM
Instead you need to fetch the user row from the database and see if that one returned anything
 
@Patrick How about foreach ($stmt as $row) {
if ($user && $pass == true) {
echo "Logged in";
} else {
//error.
 
I think fetch only returns one row? but either way, don't check for $user and $pass there. Instead check for $row['username']
if($row) would probably do too, but make sure you check the documentation first
 
Weird, nothing echos.
if ($row['username'] == true) {
@Patrick Any ideas?
 
4:37 PM
5
Q: PHP not displaying errors

TimI have a small script which im using to test PHP mail(), as below: <?php error_reporting(E_ALL); ini_set("display_errors",1); mail('x@x.com','test','test') or die('could not send') ; echo "Mail Sent"; ?> When I run this script I get no output at all. I don't get an error, I dont get anythin...

 
@Patrick Just made a php.ini and added display_errors = 1
Still nothing.
 
http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php
and then restart your server
 
I hate it when gecko works, but webkit/blink doesn't…
 
@Patrick Tried it, no errors.
foreach ($stmt as $row) {
if ($row['username'] == true) {
echo "Logged in";
} else {
echo "Error";
}
}
 
v3c.fwtools.de/user/de11/491.svg?time=20000&tiraStyle … someone can tell me why that works in firefox, but not in chrome/safari?
 
4:46 PM
@RahulKhosla if you have no echo and no errors, your error reporting is messed up. Fix that first
works in FF and chromium here
 
@Patrick so, you see in both vertical numbers?
 
@bwoebi ah... no. sorry
 
AAAAAAaaaargh I was 2 moves away from an 8192 tile and I fucked it up
 
great
 
Please help
1
Q: Wordpress query loop to get taxonomy based data

devoI have a newsletter subscription system based on category. I mean user can choose the categories for subscription (event-categories taxonomy). The post_type is subscriber and the post_title will be the user email.For subscribed users, the post_status will be subscribed. So what will be the best ...

 
@bwoebi Not great. I am so unspeakably fucked off, you cannot even begin to imagine
 
@Patrick Why you reply like this?
 
@DaveRandom That was irony.
 
Honestly, this is why I kill
 
kill the program^^
 
5:03 PM
 
5:30 PM
@DaveRandom you'd love to see where I am at...
 
Surely you have attained the 5th digit?
 
@DaveRandom I think he's talking about the monster grid version… and has sixth digit?
 
this was last week:
Yeah. So I have this problem... http://t.co/sOMnlIrcNU
I'm up to a 262144 tile
 
holy crap, how have I not seen that version
 
dude, I've been playing that one game for 2 weeks straight
 
5:33 PM
@ircmaxell come back in 2^5 weeks^^ (when you've attained 4 mio tile) (in half a year or so)
 
:-)
 
5:50 PM
good morning
 
6:25 PM
@PeeHaa your language is weird
 
yup
 
7:14 PM
@DaveRandom Help me out with a small little thing; why do I have to use $row['mycolumn'] ????
 
lol
 
How about you @tereško?
Im wondering why $row?
 
go fork yourself
 
Sorry Im still raw.
 
7:42 PM
Hi everybody!
 
@VeeeneX Hi
 
Can someone help me with vote system?
 
Im new to php, can you help me?
 
Ok
 
foreach ($stmt as $row) {if ($row['username'] && $row['password'] == $user && $pass) {echo "lol";} else {echo "no";}}
Im getting no results, or errors.
 
7:47 PM
@RahulKhosla what is in $user
 
$user = $_POST['username'];
$pass = password_hash($_POST['password'], PASSWORD_DEFAULT);
 
foreach ($stmt as $row) {
if ($row['username'] = $user && $row['password'] == $pass){
echo "lol";
}else{
echo "no";
}
}
problem was on line $user && $pass
 
Still no errors or echo
 
and if you want to get errors try
error_reporting(-1);
 
@VeeeneX In PHP tags? I tried that, no results.
 
7:50 PM
yeap like <?php error_reporting(-1);
And are you sure that you getting a values?
 
no errors still
Il var dump $pass and $user
 
@Gordon Your language is weird
 
sigh I need a bit of an urgent help regarding tor
Jun 28 15:53:06.000 [notice] Application request when we haven't used client functionality lately. Optimistically trying directory fetches again.
Jun 28 15:53:08.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:0. Giving up. (waiting for circuit)
I get this repeatedly when I try to connect to tor
 
@VeeeneX what should my password be in db?
 
any idea?
 
7:54 PM
@RahulKhosla Hmm
 
If im hashing the output
 
@SecondRikudo your best bet would be visiting tor's IRC channel
 
$pass = password_hash($_POST['password'], PASSWORD_DEFAULT);
 
Oh
 
How was it BTW?
 
7:57 PM
@RahulKhosla problem is in db
I mean you arent getting data
 
@VeeeneX So pass should be the hash output or just a normal pass?
 
Nope
 
abc123 would output something different every time..
 
I dont know if you getting a data
 
18 messages deleted
 
7:58 PM
Power!
:P
I want to have magic delv powauhs!
 
17 messages moved to bin
 
Think of all the evil I could do !!!!1einzeinzeinsz
:P
I'll join @ircmaxell in the bin
 
@PeeHaa was pretty awesome. DPC has quite a high level of quality when it comes to talks
 
He looks lonely
@Gordon I wanted to totally go but than I decided to start my own business and forgot the benifits of having a boss pay shit for you
Thinking about going to PHPNW though
You are not working for a boss right @Gordon
 
@PeeHaa but conference expenses are fully deductible from your income so it helps to spend that money. plus its well invested.
 
8:02 PM
@Gordon I just started this shit so I am just finding out where the funds are :)
 
@PeeHaa i do. ive joined a company seven months ago. but i attended conferences regularly also when i was still freelancing
 
Ow I thought you were still freelancing
Does it work for you being under a "normal" employee again?
 
@PeeHaa yes, pretty much.
 
Or are you still doing both?
 
ive got one project that i still maintain, but thats it
 
8:06 PM
brb in 2.57 :p
lulz
Also zermany is going to have a tough time in #WM2014 if they don't get their act tigether
 
@PeeHaa Beware the Vacoom!
@PeeHaa I think no one in Schland expects them to win. We got high hopes though.
 
Still my favorites the team I exoect to win
 
8:24 PM
foreach ($stmt as $row) {if($user == $row['username'] && $pass == $row['password']) {echo "YES YES YES";} else {echo "WO WO WO";}}
It won't echo the else.
Any ideas?
 
Kal
8:45 PM
hey
 
hi
@Kal Any ideas on my Q?
 
Kal
looks like nothing wrong with your statement
double check with this foreach ($stmt as $row) {echo $user . " " . $row['username'] . " " . $pass . " " . $row['password']; if($user == $row['username'] && $pass == $row['password']) {echo "YES YES YES";} else {echo "WO WO WO";}}
 
@Kal Nope
 
Kal
what does the echo show?
 
YES YES YES
If login = correct
but if not, nothing.
 
Kal
8:52 PM
what do you get with echo $user . " " . $row['username'] . " " . $pass . " " . $row['password'];
 
echos the post of username and password.
2 times each.
 
05:00 - 21:0021:00 - 22:00

« first day (1351 days earlier)      last day (3591 days later) »