« first day (1015 days earlier)      last day (4158 days later) » 

00:00
@Simon_eq you shouldnt create objects inside of objects unless that is the objects job.
who is married on here
lol
@jono im am 13 years
how you code your wife
lol
Joking Mine is a bit difficult at the moment
@jono the minute i figure that one out it will be time for a new one :)
Anonymous
@Orangepill I had the feeling it would not be a good idea. I just wanted to keep the codes neat when being instating the class. But, the object itself is like 30 lines ... is that normal? does it happen a lot?
00:03
lol
@simon_eq that what di is all about...
@simon_eq the minute one object makes another you are creating a tight coupling between the two. if an objects job is to return objects then it is okay...ie factory, builder, dic.
damn this is the only room active
who knos a bit of ios
Anonymous
@Orangepill thanks. this is what is concerning me. I am not sure, if I am doing it the worst possible way.
Anonymous
I can't even tell if it is good or not. Because, I never saw how this things are made in real websites.
Anonymous
It does the job nicely. But, the object looks like a mess.
00:19
Can you please check if it's right? Tried to get it from source, but I'm still not 100% sure if it's correct, even after looking half an hour at it: stackoverflow.com/a/17892938/2153758
00:29
I shall leave you once more in the warm embrace of Florence.
nite @all
Anonymous
night
00:57
Has anyone a less hackish version for getting the milliseconds here: stackoverflow.com/a/17893162/2153758
01:11
@DaveRandom how do you figure that one?
woot, i can chat now. hi all =)
Gooooooooooooooooooooooooooooooood piss drunk evening room 11! Good evening
@PeeHaa Good night. I'm going to sleep now.
night @bwoebi
01:35
@bwoebi php.net/manual/en/function.date.php the u version is what you could look at. It does have a note about the difference between date() and DateTime::format() though
Hi all!
@PeeHaa... It's always you?
What are you doing now?
Secret project or what?
 
1 hour later…
03:18
Great minds think alike +1 — apaul34208 3 mins ago
As if he didn't read the answer before ^^
J L
J L
simple question: in what directory do you all usually store your php error logs?
webroot? webroot/logs? /../logs?
I wonder if anyone here could take a look at some code and help me to figure out why it is not working past midnight, I'm using time() and date() to execute some output but for reason my logic isn't matching up quite right
Here is my code: pastebin.com/NrveART6
Here is a test site where I am testing changes: khill.mhostiuckproductions.com/siteNowplaying
Here is the actual implementation site: dev.bearcastmedia.com
J L
J L
03:34
did you ask it as a question on main?
you'll get more eyes on it
guys, got a quick css question
I haven't yet, I planned on doing so tomorrow. I'm here now to try and get some eyes on it for the next 30-40 minutes as it is about to swap over to midnight here
 .LinesTable tr td:nth-last-child(3) {
    min-width: 70px;
    max-width: 70px;
  }
how to tell the selector above to apply it to the th as well..
without adding another css for the last 3rd th as well
Only way would bee to add a comma and start a new selector
@HaLaBi

.LinesTable tr td:nth-last-child(3), .LinesTable th td:nth-last-child(3) {
min-width: 70px;
max-width: 70px;
}
really...
ok thanks
03:37
yes sir/mam
@Michael thanks
03:49
@JL Could my problem with thise code not working past midnight have to do with this: 5.0.2 In PHP 5 up to 5.0.2, "now" and other relative times are wrongly computed from today's midnight. This differs from other versions where it is correctly computed from current time.
I got that from the php manual for strtotime() which is what I am using to check the current time is within two times I defined
@Michael why are you using such an old version of PHP?
I'm using 5.2.17
which is very old
5.3 is at end of life, you should be at 5.4 at minimum
Really? My server has that listed, I'm not sure how to update it
Also you really need to turn on full error reporting while coding, there are multiple errors in your code which it should have warned you about.
03:59
k
@Michael yes, and what do you mean listed?
Has 5.2 listed, though I just found how to change it. It's on 5.4 and what do you know, it now runs properly haha
I'll turn on error reporting and go through the errors
My primary issue has been resolved though, I never even thought to look what version I was running until I noticed that comment above for strtotime()
@Michael you should not put your arrays into functions just so you can access them within another function. Inject the dependency by passing it to the function or use the 'use' keyword, here is an example on how to use it for something like what you are doing blog.dubbelboer.com/2012/04/07/php-use-keyword.html Also use DateTime() it will cut down on your code and make it a lot easier to work with.
Hello
I need help
about PHP + XML
0
Q: Show all items that Match in XML using PHP

ManuelThis is my XML file named: full.xml I need your help. I need a PHP script that open "full.xml" and only display all values of the nodes that have .email Example of the Output I want: [email protected] [email protected] [email protected] Thanks! I will thank you so much!

@crypticツ thanks, I will take a look into both of those. Sticking the arrays into a function like that is ultimately very temporary, all of this code is really. The function fix was suggested by someone on a post I made last week. I need this done in the next 3 weeks so I am ok with bruteforcing it right now. Eventually all my output arrays will be generated from a database
04:13
@Manuel what have you tried?
@tereško still here?
@crypticツ I tried:
$Connect = simplexml_load_file("full.xml");
return $Connect->table[0]->*.email;
But it doesn't how what I want
show*
04:36
@manuel check out this stackoverflow.com/a/8884736/2364629
Ok, let me check
I'm trying but no result. Help me please if you can
Javascript room isn't active, does anyone here know JS and if so, could they please help me with 7 lines of code?
@TheGuyWhoCouldn'tTalkToTheGirl post the code
$(document).ready(function(){
    $('.clickMe').click(function(){
        $('.dark, .box').css('opacity','0.9');
        $('.dark, .box').css('display','block');
        $('.box').css('opacity','1');
    });
});
Does anything look wrong in that code just by looking at it?
@TheGuyWhoCouldn'tTalkToTheGirl At a glance, no
04:50
@TheGuyWhoCouldn'tTalkToTheGirl apart from you using jQuery not that I can see
sigh for some reason it just doesn't work :(
But why are you applying opacity to .box twice?
what's console log say
@Orangepill Nothing, that's the biggest problem of all.
@crypticツ Yeah, that was my mistake, but still, the problem persists.
can you link us to the page?
04:53
@TheGuyWhoCouldn'tTalkToTheGirl In that case, I would suggest simplifyingg your code. Cut it down to yourr first line and target just .box. See if it works, build up from there bit by bit. That's what I do when I get weird javascript/jquery issues like that.
what's it supposed to do
Dim the background and bring up a DIV.
Problem is, it works on JSFiddle, but not on the website.
do $('.clickme') in console....does it return an element
One sec.
@Orangepill Yes, it does.
how about $('.dark .box');
05:03
whats the right syntax for this css im trying to do?..
			.box:hover {
				.gridtitle {
					display:block;
				}
			}
or does that have to be done with js?
@Orangepill Nope, so apparently I have to divide up the statements since they can't be done together.
should be a horse a piece... if you are switching css of .box when .clickme is clicked it's js
do is box a child of dark?
try $('.box').find('.dark')
or it it's a direct child you should be able to do $('.box > .child');
Nope, its <div class="dark"></div> and the next line is <div class="box">
Two separate.
just read above messages :P
:10877652 That didn't work either. It only returned the box element.
05:09
do you want it to effect both... do $('.box, .dark')
@Orangepill That only returns login-box not dark
are you sure dark is a class and not an id?
@bushdiver is gridtitle a decentdent of .box or are they the same element?
@Orangepill decentdent
05:14
and $('.dark') is giving you what you expect
@bushdiver .box:hover .gridtitle {display:block}
@bushdiver if you like the nested rules you can look at less or sass as a css abstraction... I think it's more programmer friendly but you have to go through a compilation step.
Yup, $('.dark') gives [<div class=​"dark">​</div>​]
@Orangepill that was it, thanks =]
@TheGuyWhoCouldn'tTalkToTheGirl $(".box,.dark") should give you the goods
@TheGuyWhoCouldn'tTalkToTheGirl can you share your fiddle?
m59
m59
05:32
oh my dang.

$foo = [];
if (bar($foo) || baz($foo)) {
  var_dump($foo); //empty array!?
}

function bar($foo) {
  $foo['qux'] = 'something';
  return true;
}
You have to return the changed array??
@m59 you should. Other options would be references or globals, but returning is the best (and in my mind, only) option
m59
m59
sigh
php scope is nonsense.
would it make a difference if $foo were an object?
@m59 What is that directed towards?
m59
m59
huh?
@m59 why are you saying the scope is nonsense
m59
m59
05:34
Because it's very non-intuitive.
@m59 It's confusing at times, but I wouldn't say non-intuitive
@m59 you can avoid returning the changed array by passing the array in as a reference
@Orangepill probably discouraged though when returning is just as easy
m59
m59
I thought that's what I did, @Orangepill
how do you return it in an if or statement?
@m59 No, references are made using the & sign.
m59
m59
05:36
Ah.
@m59 The if has nothing to do with the reference
function bar(&$foo) { blah blah blah; }
m59
m59
if ($foo = bar($foo) || $foo = baz($foo))
?
@m59 don't have to do anything special there
Why are you avoiding using a returned value, though?
05:37
actually you will get a warning if you try preceding those with an &
m59
m59
I need the statements to return true or false....hence if bar or baz
@Jeremy he is using it as a test in an if
@Orangepill So?
m59
m59
Could I just show you guys some code and maybe you can help me refactor?
I haven't figured out a good structure for php at all.
Try to isolate
05:39
so if he has to return the array despite the outcome the test will always return true even if he does nothing to it and falls into the condition where he should return a false.
m59
m59
My main problem with php is how to pass things around. The scoping and this type stuff is nothing like js.
@m59 nope ... it's more like C
@m59 Give us a simple code sample, don't paste your whole project, is all I'm saying
m59
m59
It's not too long...should be easy to understand, just start at the first function there
Because there are a lot of conditions, I started with the basics and expanded on it...
it just got so silly as I went.
Mainly because the different scenarios share information
ech. what's the issue
m59
m59
05:43
I just want to know what a good coding style is.
@m59 That's kind of general. But your code is pretty smelly. I suggest reading up on some architectural patterns
m59
m59
Like, in js, I've got a very good object oriented, clean structure.
But I can't do any of it in php...I don't know what to read.
@m59 I'm reading poeaa right now. You could give it a try, though I'm not sure where you are in programming (advanced/beginner)
m59
m59
Intermediate, I'd say with js.
Better than a lot, I think, lol.
Okay, well if you want take a look at poeaa (teresko suggested it to me today), and read up on SOLID principles.
05:46
LOl
pseudo-prototypical oop is a wold of difference away for classical oop
@NullPoiиteя well... that's one way
Anyways, going to go to bed. @m59 everything good?
m59
m59
heh, I'll figure it out =D
@m59 I wouldn't start with poeaa... you probably need a primer on classical inheritance and some practice... I would go with a php oop intro book
m59
m59
thanks dude, night @Jeremy
05:49
(^ wasn't sure his level)
m59
m59
I actually do know some about classical. When I started with js, I was using a pattern that is supposedly close.
But it really sucked for js, lol.
I don't know how adept at js you are but its kinda a brain f*** when you switch from a classical oop to a prototype oop
m59
m59
What would be great is if I could see some good php code.
I fought with it going the other way
m59
m59
I've actually never seen any.
As crappy as my code is that I just wrote straight through today with no revision, I promise it's the best php I've ever seen. It makes it kind of hard to learn, lol.
05:52
I still say start out with a primer book.... you won't be able to appreciate any code until you have a baseline of understanding
m59
m59
And it's not that I haven't seen much, I've seen a ton.
@m59 Oh god. I wouldn't say so. If that's what you honestly think, you should definitely read some nice tutorials and learn to evaluate code
Is it possible to get live log in xampp?
m59
m59
Dude, I'm talking about people using numerical arrays for information that can't be described numerically, etc.
junk like that.
Wait
best example ever
<script>
<?php
      echo $jQuery;
    ?>
</script>
^ that happened.
Now do you believe I've seen awful code forever? lol
@m59 I'm almost positive it was from a beginner. And, even so, they must have been using PHP intertwined with their Javascript and didn't know how to properly deal with it. We've all seen awful code, but the moment you start to believe awful code is the best you've ever seen... well, that's the moment you gotta re-evaluate. Off to bed for real now.
05:55
@m59 lol
m59
m59
night dude
I really just haven't seen any good php code. I don't know where to look. It's all garbage on google tutorials I've seen.
whohoo.... third good answer badge
m59
m59
I can show my wife very complicated js scripts and she can reason about them because the functions and vars are named appropriately and broken up well.
@Orangepill dont you get silver badge ? i thought your answer is oldest isnt it ?
When you get the basics look at Zend_Framework 1.x for good oop
m59
m59
05:58
Just looking at this part:
    if ($this->checkCookie($data) || $this->checkLogin($data)) {
      $this->giveAuth($data);
    }
Doesn't that make good sense?
It sounds and looks just like what it's going to do.
Is there a better way in php?
the biggest issue with that one is you are not passing $data into the method
m59
m59
right
and what is $data? an array with username and password? a string that names the cookie, a request object that gives you both?
m59
m59
It's kind of arguments that just need to get passed around.
stuff I grabbed either from the cookie or from the server that I'll need when granting the session
@m59 you are used to javascript where the concept of a class is foreign and data would be there because it's available in the caller's scope.
m59
m59
06:02
well, I'd have to pass it in, just like I did here.
Oh, I think that's what you meant.
good news - there is a patch for setting a flag to include the end date which (fingers crossed) will make it into a future version. — salathe Jul 8 '10 at 20:51
@salathe did this ever happen ^
m59
m59
Maybe that's what I really need to ask. How would you do that so that they can share information?
That's the issue I run into every time I write php code.
Just use the &?
Is there a way to monitor XAMPP?
@m59 if you want to edit a parameter without returning it that is how it's done
@TheGuyWhoCouldn'tTalkToTheGirl In what respect?
06:06
@Orangepill Monitor the Server load and the requests being made. Basically a live monitor of traffic.
That's an example.
@TheGuyWhoCouldn'tTalkToTheGirl holy crap 3 bear .on desk ... now no need to monitor :P
Is wizards.com/Magic/PlaneswalkerPoints/JavaScript/… a valud url to pull json data from?
@TheGuyWhoCouldn'tTalkToTheGirl I don't know of one (im 100% linux)
@PaulELI dunno...
> Planeswalker Points has experienced an unexpected error.
Please try again soon.
the error persists, contact Game Support.
06:12
By using Chrome's inspect, network tab, the preview is showing the json data, but when I try and grab is with curl, I am only grabbing the error page
I tried setting my headers correct in the curl, but still I only pull the error page.
They may be sniffing an ajax request, try grabbing it with jquery
@NullPoiиteя I wasn't first ... one suggestion to play musical chairs with the str_replace got in before me
Ok Orange, thanks~!
user2543022
hello everyone
user2543022
06:25
i need help from someone can anybody help me
user2543022
hi
user2543022
pauIELI
@PaulELI you can set xmlhttprequest in the HTTP_X_REQUESTED_WITH header
@krishna what's the problem?
m59
m59
It is possible to tamper with session cookies, right?
it's possible to highjack them ... tampering with them on the client side wouldn't do you any good unless you just wanted someone to drop there session
user2543022
06:31
yes sir i am using wordpress i am installed woocomerce plugin and i added the first data payment gateway(premium) to my wordpress site. now i am able to enter credit card details but when i enter credit card details it is showing first data system error for me
user2543022
waht is the reason
user2543022
i didn't get
m59
m59
Oh ok, so I don't need to make sure all of the properties are there, since I set them and they couldn't fake a check on them?
@krishna I'm not familiar with wordpress or woocommerce
user2543022
here anybody is there to help me
06:33
@m59 a client can make up anything he wants and send it as a cookie.... nothing sesitive should go in one.
m59
m59
@Orangepill in other words, if I say something even as simple as $_SESSION['loggedIn'] = true, then if ($_SESSION['loggedIn']) is ok to check?
@m59 yes.. they can't change the data in the session.... just the cookie.
m59
m59
$_COOKIE
^ that
right...
m59
m59
can't be too safe, lol.
06:37
-- or manage your own sessions with a database :)
m59
m59
Is it worth calling it every time though?
That would certainly simplify things.
But it would cost the speed of having to query it every time they make a request.
There is a lot of advantages to storing session data in the database.
@m59 you could cache it ... only hit the database on write
like on delete collapse
if a user were deleted, their login session would also be deleted
m59
m59
The only thing is, how do you end it?
I usually use db sessions when I want to ensure that any given user is logged in at one location (it also keeps people from sharing logins)
m59
m59
06:41
I'm ok with them sharing and using multiple locations
cache timeout... on a cached record you can check mtime and touch the file every time the session is accessed.
@m59 session_unset(), session_destroy();
^ and what he said
m59
m59
that's a session, lol.
I thought you meant to avoid the session.
oh to end cookie sessions (sessions managed by yourself via db), just delete the row in the db
m59
m59
06:42
but they'd have to log out to do so.
I have both. I use the cookie/db to grant the session and then I just check for the session
something like a form to post to logout.php?
and some freaky token to pass along with it
m59
m59
I mean the traditional, keep me logged in thing, or they lose the session when they close the browser.
Is it possible to access localhost from a VM?
oh, lose the session is when you set the cookie as a session cookie, (if they check the remember me, it either keeps the cookie forever or expired after a few hours)
Localhost being the VM itself or the VM's Host OS.... the answer for both is maybe.
06:45
@TheGuyWhoCouldn'tTalkToTheGirl connect to your host machine via lan ip
usually it's the VM's gateway address
m59
m59
should I fear someone stealing sessions? How much of a problem is that really?
oh yeah...are you using vmware or virtual box?
m59
m59
If it's at all reasonable, I could really ditch sessions
06:46
@m59 it's trivial... there is a browser plugin for firefox to do it
@m59 use https and htmlentities, problem solved
m59
m59
https not an option :(
htmlentities? how does that help?
@Orangepill localhost is on Host OS.
I decided since there is no apachetop for Windows, I might as well install Ubuntu on Virtual Box and monitor XAMPP (on physical computer) from there.
@m59 If you're accepting user content, (comments on a blog), htmlentities escapes html, so they can't be used to xss sessions
m59
m59
Oh, of course.
06:48
@TheGuyWhoCouldn'tTalkToTheGirl but your VM is localhost too :) ...
@TheGuyWhoCouldn'tTalkToTheGirl do ifconfig at the command line and try hitting the listed gateway address.
@Orangepill Default Gateway . . . . . . . . . :
m59
m59
now I'm back into the debate of scratching $_SESSION altogether and just looking up the two cookie tokens in the db each request.
is that feasible?
@TheGuyWhoCouldn'tTalkToTheGirl can the VM get out to the world at large?
m59
m59
that would mean a faster response on ending the login if it were hijacked.
@m59 if they can hijack one cookie they can get both...they are in the same request
m59
m59
06:56
yep, but they'll get locked out pretty fast if there's no session.
The hijacker will cause the token to change and then the real user will attempt to use an old token and they both get logged out right then
@Orangepill What do you mean?
m59
m59
rather than having the session allowing the hijacker to continue until the real user closes the browser and comes back later to the site
@TheGuyWhoCouldn'tTalkToTheGirl Can the VM see google.... based on the number of dots there might be some IP6 magic going on that I haven't a clue about :(
@TheGuyWhoCouldn'tTalkToTheGirl try running route -n
07:32
@vascowhte Can you give me your blog to follow your php articlas? — Priyanga 14 mins ago
How flattering :)
afternoon, quiet day huh
@Mr.Alien yeah...I'm about to tap out...
@Orangepill aa, so what I will be doing alone, I will leave too ;)
have a great weekend pilly..
you too alien
07:43
:) cya
just look at the frog's face. it's like "pff, that rain … can do me nuthin."
08:04
mornign
@DaveChen ooh, did you use the auto retagger?
nah, just manual :) stackoverflow.com/posts/10112805/revisions and not just retag edits
:D did you commit too?
I wanna get stackoverflow.com/help/badges/30/beta even though I know it won't be on my SO profile
@DaveChen am already committed :P
did you get stackoverflow.com/help/badges/892/precognitive ? I didn't get it because I was too late :c
@DaveChen nio :(
idk why i havent got that badge ?
hahahaa beer Q&A, interesting
08:24
@DaveChen it was just area51 rep whoring :D
area51 has less privileges D:
@DaveChen but if makes my flair better
then why not just sign up for every SE website?
@DaveChen why sign up ?
you get 100rep
08:27
@DaveChen but its not useful ...
when we can not participate :P
@DaveChen gold badge on every site :) he visited every site for 100 days ... true badge lover
yibe, Japan
1.2k 1 8 15
badge lover ^^^
haha, aren't we all :P
5 messages moved to bin
preg_match("/^http:\/\/.+@(.+)$/","http://[email protected]",$matches);
echo $matches[1];
08:36
@DextOr +1
out put : pcds.co.in
how this thing works /^http:\/\/.+@(.+)$/
@DextOr What do you think it does?
From left to right?
i think there are sm symbols which are removing or showing characters
hey @NullPoiиteя one of ur link [ rick.measham.id.au/paste/… ] is cool
@DextOr also try this .. its looks useful regexbuddy.com
08:42
but it's $40! that's like a whole years income for the average web developer
@DaveChen i dont want to post [warez or torrent here]
regex imho should allow multilines omg, I'm glad I'm not in the UK/US, I can still torrent xD
@DaveChen we all
@DaveChen you mean /x?
nah, like ex:

preg_match(
    "/
    ^http:\/\/.+@(.+) //oo comments?
    $/
    ",
    "http://[email protected]",$matches
);
08:47
@DaveChen YOu can do that
oh, never knew xD
:-)
jk :P, but I honestly dislike regex, since it's usually the slow method
See the x modifier
@DaveChen Don't repeat what others say without actually testing it
no I have done benchmarks with filter_var and the RFC for emails
Validating email is an entirely other beast
@DaveChen BTW you know filter_var is using a regex pattern right?
yeah but it's running through C code/native right?
@salathe :(

« first day (1015 days earlier)      last day (4158 days later) »