« first day (2409 days earlier)      last day (2761 days later) » 
00:00 - 12:0012:00 - 00:00

12:00
Alright. I got confirmed.
Will someone be ever so kind as to take a look at rahul.tech/gossipmonger/index.php ? :P I'm new to PHP and this is like the first thing I've made with it
well ... something works
Morning 0/
@tereško lol
read the faq to know how text formatting works
12:30
@Rahul2001 do you know what XSS is?
12:45
It's like CSS, only better, right?
@DaveRandom Exactly.
Have you heard of DICSS?
I'm a bit afraid to google that
@tereško sfw
@PeeHaa yes
I thought I solved it?
12:49
@MadaraUchiha oh ... that's an oddly appropriate name, for a practice, that will completely fuckup your separation of "three layers of web"
@Rahul2001 <script>alert('hello?');</script> run this as message
For example :P
ah , satire
@PeeHaa won't get executed
12:52
ok...
did you run it though?
@PeeHaa hm? Yeah, I think I've done a pretty good job of input sanitisation
So just to be clear. You just ran that now right?
@Rahul2001 no, its not solved. I tried it just now
it get's executed, when you submit the line
imma take that as a no :P
12:57
if you use the htmlentities() function it will convert the < and other HTML syntax characters into entities like &lt;
to anyone who doesn't get that reference: screw you. I'm old, idgaf about you. /cc @JayIsTooCommon
@the_velour_fog s/htmlentities/htmlspecialchars/
@the_velour_fog whatttt
Shit
Pro tip: when somebody in here asks you to check something don't just assume bugs don't exist
especially me
and @PeeHaa, in fact
13:02
And ignore @DaveRandom
:P
room topic changed to PHP: Support group for those afflicted with PHP. Don't ask to ask, just ask. Username auto complete is *tab, not enter. Ignore @DaveRandom. Chat Guidelines : guide.room11.org [php]*
@PeeHaa Okay, so, it's an error with the jQuery
This is embarrassing
So if I type it in, it only gets executed on my machine, not the rest of the online users.
Idunno
I stopped looking at it when I found it
@PeeHaa I'm just reading stackoverflow.com/questions/46483/… Am I correct in thinking the reason to prefer htmlspecialchars over htmlentities is because htmlentities will print a whole bunch of unnecessary &amp; &nbsp; etc? whereas htmlspecialchars only does enough transformations to prevent code injections?
@Rahul2001 kinda how "run this in mIRC to get a new theme" worked
:P
13:06
@the_velour_fog correct
wait ... you are 15 .. you dont know what mIRC is
@tereško Ah, the good old days.
So many channels taken over.
@PeeHaa cool, thanks
@tereško I like the more harmless "What?! I didn't know ALT+F4 decreases your ping by 30!"
13:08
fuck, I feel old now
@PeeHaa Okay, solved
@PeeHaa Sorry, my bad
Anonymous
I just got Spotify premium for 3 months for 0.99.
Anonymous
Today has been good
13:19
when you are starting the new job?
Anonymous
It was to be on the 24th of this month, but I asked to start 1st of June.
Anonymous
They said, it's ok
Wes
Wes
@pmmaga yo
is that what i think it is? :D
yup! ^^
Wes
Wes
YES :D
what really worries me is
why the hell traits' methods are checked in a different way?
13:25
mostly because they are not simply inherited, if the method already exists in the class then the existing method overrides the trait one
checking in both directions seems to have been a brute force solution to a smaller problem that caused this inconsitency
Wes
Wes
so wait, it did the check the other way round?
this is so complicated
it always checked both ways when one of the sides was an abstract
13:42
evenin room
Anonymous
@DaveRandom what's so special about this type of tree?
Anonymous
!!? Tree fiddy
Search for "Tree fiddy" (https://www.google.com/search?q=Tree+fiddy&lr=lang_en)
• Tree Fiddy | Know Your Meme - 30 jan. 2012 - Tree Fiddy” is a catchphrase associated with a story about the Loch Ness Monster ori… (http://knowyourmeme.com/memes/tree-fiddy)
• Tree Fiddy - YouTube - Chef's Parrents telling stories of the Loch Ness Monster wanting Tree-Fiddy. (https://www.youtube.com/watch?v=9xCAs08QPNw)
• 3 Fiddy - South Park 720p - Lock Ness Monster - Y… - Meeting Chef's Parents and the Lock Ness Monster. (https://www.youtube.com/watch?v=6a3BGs1uxfg)
user924016
mornings
user924016
13:47
damn got up real late
I know this is not PHP, but has anyone here ever used Pascal?
I keep getting this error: "Identifier class not found" when the syntax is perfectly fine.
@HassanAlthaf I haven't used Pascal, but that sounds like a linking problem.
Wes
Wes
isn't pascal like super old
Do anyone knows how MediaWiki instant commons works? If I enable it then will it download related images from Wikipedia to the server automatically?
@MadaraUchiha I had to use a directive.
@Wes Used in schools to teach.
I'm using PASCAL tomorrow for the last time.
13:58
@HassanAlthaf The Prime Directive?
@DaveRandom {$mode objfpc}
Found it in their docs.
We were never taught about this at school.
@HassanAlthaf somehow I suspect Starfleet's exact text is more verbose than that
@DaveRandom wdym
What I mean is that clearly you have not spent enough of your life watching Star Trek and that this is a situation you should remedy immediately.
TV is too boring.
14:01
> clearly you have not spent enough of your life watching Star Trek
:-P
I spent most of my life studying, at the gym, school, coding, gaming.
I barely watch TV.
I am genuinely a little jealous
why
you don't want my life. my life sux
because I have no self-discipline whatsoever
ahh
We just get it somehow..
14:05
well I have all kinds of opinions but I don't feel capable of expressing any of them constructively right now so I just won't bother trying
lol
fair enuf.
Can't believe I am expected to write something like that on a piece of paper...
I hate writing programs over 10 lines on paper
I've never understood the idea of writing code on paper, at least not now
I make a lot of mistakes writing code in an IDE, I rarely write a single line of code that I don't go back and correct in some way at some point, and I don't feel like that's a problem
Wes
Wes
@DaveRandom i'm watching tng in english. patrick stewart's voice is how i imagine god's voice :B
14:22
wait, have you never watched it in English before?
I can't imagine that Data carries over well when dubbed, so much of that character is based on the performance and so much of the performance is based on the delivery of dialogue
Wes
Wes
i tried once but i struggle. i still struggle a lot with english
i can only understand data and riker basically
Well yes I certainly have no room to criticise when it comes to linguistic ability
Wes
Wes
others "speak within their mouth" as we say in italian
@Wes Both Crushers probably, to a lesser extent, I guess
Wes
Wes
worf is the hardest probably, or picard. picard is very clear when speaks loudly, otherwise i struggle a lot
14:31
\o
Wes
Wes
@DaveRandom deanna troi is not english right?
> Nationality British
Marina Sirtis has a (slightly weird) English accent when she speaks but I think she's Greek(?)
Wes
Wes
i think what makes it hard in the end is the poor audio quality, there's a lot of echo
The early ones certainly
I think they were pretty tight towards the end
14:38
@DaveRandom that is... a very strange accent
everything about this is a cinematic masterpiece https://t.co/pmsxaRfuDC
@Leigh it's kinda posh-transatlantic with a bit of generic european mixed in
Wes
Wes
Playing the long game. https://t.co/eGUO1wjSqJ
14:52
hi
please could someone help me just converting a query to a pram query ?
15:05
@Bradley you should be able to do it yourself
@tereško I know how to do it in PDO but I need to use mysqli procedural only in this case
I would really appreciate it if someone could have a quick look at it, I have spent a good few hours looking how to do it
$model_search_query = "SELECT * FROM models WHERE model LIKE '%".$_POST["search"]."%'";
$model_search_query_pass = mysqli_query($cameras, $model_search_query);
user924016
Hi Bradley
Hi there
user924016
There is a bit of a security issue in that code that kinda hard to ignore
user924016
but anyways, what was the issue, are you getting a error?
15:11
Well I want to protect it from injection, so I want to convert it to a prepared statement
How could I do this relationship in Laravel?
I know how to do this in PDO, but in this case it needs to be mysqli procedural
user924016
yes and $cameras is a resource to the db?
Yes thats right
user924016
and what was wrong again?
15:13
It currently works fine, but I want to convert it to a prepared query to prevent sql injection
I need to do it in mysqli not pro
user924016
and what have you tried?
pdo *
To be honest I have spent a couple of hours playing around with it, I have rewritten it probably 20 times
user924016
I asssume you tried something like php.net/manual/en/mysqli.prepare.php and it failed?
yep, I have read that
this is what the code works with :
<!-- GET THE MODEl -->
<?php
$model_search_query = "SELECT * FROM models WHERE model LIKE '%".$_POST["search"]."%'";
$model_search_query_pass = mysqli_query($cameras, $model_search_query);
?>


<?php


if(mysqli_num_rows($model_search_query_pass) > 0) {

while($model_search = mysqli_fetch_array($model_search_query_pass)) {
//GET THE BRAND
$brand_search_query = "SELECT brand FROM brands WHERE id =" . $model_search['brand'];
$brand_search = mysqli_fetch_assoc(mysqli_query($cameras, $brand_search_query));
I am trying to convert the query over to a prepared mysqli query rather than PDO
user924016
Yes, and I would like to the how far you got in solving that
user924016
15:18
and can help you when you are stuck with actual code
I have spent like 3 hours on it, converting it over I know is like 4 lines of code, please can you show me,
@RonniSkansing I attempted changing it over to PDO like this
$model_search_query = $cameras_pdo->prepare("SELECT * FROM models WHERE model LIKE '%". ":search" ."%'");
$model_search_query->execute(array(":search"=>$_POST['search']));
$model_search = $model_search_query->fetch();
however now it is incompatible with the rest of the code e.g mysqli_num_rows and mysqli_fetch_array
Php is not allowed to use "class list" – #74624
user924016
so the only reason you want to use mysqli is because you didnt know how to replace the mysqli_num_rows and fetch_array ? @Bradley
Basically yes,
user924016
Okay, you can find the equivalent in PDO
15:24
SQL_CALC_FOUND_ROWS isn't it ?
I know how to use count() however I would need a whole separate query that is also prepared
it seems quite inefficient, when I could just do it in mysqli ?
user924016
as you can see from the link I gave you
user924016
the only reason mysql_num_rows() worked is because it was internally fetching all the rows to give you that information, even if it didn't seem like it to you.
okay, well I'm trying to do it in mysqli again
$searchStr = $_POST['search'];
$sql= 'SELECT * FROM models WHERE model LIKE ?';
$stmt=mysqli_prepare($cameras,$sql);
mysqli_stmt_bind_param($stmt,$searchStr);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt);
while ($stmt->fetch()) {
echo $stml['model'];
}
this is what I came up with earlier and it doesn't work, like I said before I can't get it to work with % ? %
user924016
15:35
Jumping back and forth between PDO and mysqli is really not helping yourself.
I want to do mysqli as I said right at the beginning
user924016
okay
please :/
user924016
Well there might be a couple of things
user924016
for example, did you read the doc for mysqli_stmt_bind_result($stmt); cause I am not sure what that exact line should do in your code atm
user924016
15:43
also mysqli_stmt_bind_param($stmt,$searchStr);
user924016
is wrong
@RonniSkansing im so close
$model_search_query = $cameras_pdo->prepare("SELECT * FROM models WHERE model LIKE '%" . ":search" . "%'");
$model_search_query->execute(array(':search' => $_POST['SEARCH']));
while ($row = $model_search_query->fetch(PDO::FETCH_ASSOC)) {
echo $row['model'] . '<br>';
}
is there a problem in this end bit ?
'%" . ":search" . "%'");
user924016
16:01
we are back to pdo?
yep
I would like to use pdo like I have on the rest of my site
user924016
I think that would be a great idea
Thankyou
Can you see an issue with what I posted
@Bradley, if you use Like in PDO use BindValue
@jemz Im honestly so stuck on this query it has been 4 hours, please can someone just show me how this 1 is down do I know for the rest
16:05
@jemz Why?
done *
@Bradley Pretty sure it's in the docs somewhere but you need to add the % to the value not the query
user924016
Yea ^
like this
$model_search_query = $cameras_pdo->prepare("SELECT * FROM models WHERE model LIKE :search");
$model_search_query->execute(array(':search' => "%" . $_POST['search'] "%"));
while ($row = $model_search_query->fetch(PDO::FETCH_ASSOC)) {
echo $row['model'] . '<br>';
}
yes
user924016
16:07
missing a . there I think
And drop the colon from the execute
And what @RonniSkansing said
Oh yes there is, thank you
$model_search_query->execute(array(':search' => "%" . $_POST['search'] "%"))
without a colon ?
$cmd = $this->connection->prepare("SELECT name from users where name Like ?");
$cmd->bindValue(1,'%'.$searchname.'%');
$cmd->execute();
yes
@jemz Again:
2 mins ago, by PeeHaa
@jemz Why?
user924016
@Bradley congrats
16:09
I can't believe it
It actually works!!!
user924016
Hmm.. need one of those unit pass, functional test blows up kinda gif's
@RonniSkansing g.redditmedia.com/… .
that do you?
user924016
lol thanks
user924016
perfect
@DaveRandom that pretty much sums up my experience if majority of jquery plugins
16:17
Hi I have this output via socket.
Event: Newchannel
Privilege: call,all
Channel: SIP/202-0000000f
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: 202
CallerIDName: jemz
AccountCode:
Exten: 998
Context: from-internal
Uniqueid: 1495354337.15
I want to get the CallerIDNUm and the Exten only..here is my code
if (!$socket){
	echo "$errstr ($errno)\n";
}else{
	fputs($socket, "Action: Login\r\n");
	fputs($socket, "UserName: admin\r\n");
	fputs($socket, "Secret: admin\r\n\r\n");
	fputs($socket, "Action: WaitEvent\r\n");
	fputs($socket, "Action: Logoff\r\n\r\n");

	while(!feof($socket)){
	$result=fread($socket,5000);

		if (preg_match("/\b$argv[1]\b/i", $result,$match)){
			echo $result;
		}
	}
}
fclose($socket);
I cannot echo $result['Exten']; It will raise error
16:43
Hi guys in my local machine I run the socket like this php mysocket.php somevalue, my question for this in server how can I run it forever ?
thank you in advance.
while (true) { //whatever }
I mean my client socket will always running how to do that in server ?
I search in google some suggested nohup php mysocket.php & ?
Evenings o/
Anonymous
o/
Anonymous
@PeeHaa Won't that hug up the memory?
Anonymous
16:55
I don't think it's possible to run that. Seems like it will eat up the ram just like when you run infinite loops
@jemz create a service
!!? systemd service
Search for "systemd service" (https://www.google.com/search?q=systemd+service&lr=lang_en)
• systemd.service - Freedesktop.org - A unit configuration file whose name ends in .service encodes information about a process controlle… (https://www.freedesktop.org/software/systemd/man/systemd.service.html)
• 9.6. Creating and Modifying systemd Unit Files - A unit file contains configuration directives that describe the unit and define its behavior. Sever… (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-U
/me out
@DaveRandom, how to create service ?
17:11
@samayo ?
@jemz you want to use supervisord for this type of thing, probably.
@Danack, ahh I heard that supervisord, I will try that,
Thanks
He really put some effort into learning the track
:P
17:26
Fun with property names and object casts 3v4l.org/6937a
Hi guys
i have a problem running gettext win windows using php 7
$pathlang = APPPATH."/language";

    if (defined('LC_MESSAGES')) {
        setlocale(LC_MESSAGES, $language); // Linux
    } else {
        putenv("LC_ALL={$language}"); // windows
    }

    bindtextdomain("messages", $pathlang);
    bind_textdomain_codeset("messages", $this->CI->config->item('charset'));
    textdomain("messages");
roll20.com does this work for anyone?
Integer overflow in oci_bind_array_by_name – #74625
gettext dont translate
how can I make my result to array ?
if (preg_match("/\b$argv[1]\b/i", $result,$match)){
		     echo $result;
		}
17:37
hii
can anyone tell me a good jquery bootstrap color picker plugin plz
this is the result of my preg_match
Event: SomeEvent
Trigger: ok
AuthDetail: Yes
State: 0
I want to extract the state ,but how ?
hi all
18:30
@Trowski Shouldn't github.com/amphp/amp/blob/… have a try / catch?
@Tiffany it says something about curl
@tereško yeah, same for me. I realized the site I wanted was roll20.net
they probably have roll20.com too, but haven't set it up correctly to redirect
@kelunik why?
@bwoebi I also think it shouldn't care if it's a non-generator.
@kelunik why would you pass an non-generator to a Producer?!
18:40
@bwoebi Because it might be simpler than using an emitter.
@kelunik I wouldn't say so…
@bwoebi Depends on the use case.
3 messages moved to Trash
18:57
@bwoebi See github.com/amphp/amp/pull/136/… for a use case.
19:43
@kelunik you anyway have a yield from statement there, why an if(false){yield;} then?!
@bwoebi Yes, can be removed now. Had a return there earlier.
Hai all
I'm confusing about amasty mgento navigation extension
I want to make URL with filter attributes as parameter's
gods below, I can't stand laravel users
what happened?
it seems like 99.99% of Laravel users have been beaten with the Purple Dragondildo of Stupid
(I presume it is a unique [no] common drop)
19:54
wow
"I don't like this, I want to remove it"
"but it's autogenerated by something I use"
function foobar($foobar) {
    return $foobar;
}

$array = ["a" => "b"]; $array[foobar($foobar)] = $foobar = "a";
^ Args, array entries are fine, but function calls are evaluated before, so $foobar is undefined there.
look at as a feature, that makes your code less messy
you read code more often than you write it
I know, but it's a PHPStorm bug. :P
based on the amount of people I send to @ircmaxell's "prepared statements video, I would be entitled to part of a revenue. It might even amount a whole cheap beer in 3 months or so
20:41
@bwoebi I guess that shouldn't exit with 0: travis-ci.org/amphp/redis/jobs/234609507#L189-L194
21:12
!!dad
I have a polish friend who is a roadie for a band I have a Czech one two, Czech one too, one too
Anonymous
22:01
@Linus You are from India right?
and it's something like 3AM there now
Anonymous
Oh, maybe he is up.
Anonymous
I need to know what people can buy for 250 rupees in India.
Anonymous
It doesn't sound like much but then it does ... :/
probably a meal, one of those "business lunch" things (in not-too-posh area)
Anonymous
22:06
That sounds just about right.
you will wait till he's back awake, but I assume there is also a quite big difference in city vs rural
Anonymous
Yeah, I'm picturing a fat lunch for blue collar man in Delhi.
23:24
nevermind, just close and remove it
I need to increase my rep at some point
you get less adds at 200 and at 1000 you can see the exact number of up and down votes
I use an ad blocker :x
the ads on SO are actually on topic, and not invasive (at least for 200+ users)
but , yeah, you nead to earn some rep
00:00 - 12:0012:00 - 00:00

« first day (2409 days earlier)      last day (2761 days later) »