« first day (954 days earlier)      last day (4008 days later) » 

12:00 PM
someone just unaccepted an answer after a day!
 
oO
 
nevermind
 
user2416523
@Farkie
 
user2416523
i have logical question
 
@Uresh go on
I'll be back in a minute, need breakfast!
 
user2416523
12:02 PM
ok
 
Just shoot your Q;
 
user2416523
i have one product page on first page load i load 10 products
 
user2416523
having a more button below
 
user2416523
when i click ion more the page should remain same as it was before and new 10 product should be load..
 
And where does the problem start?
By clicking the button? Can you provide us with some code?
 
user2416523
12:04 PM
no
 
user2416523
i m jsut developing logic first
 
@Uresh so use an xml http request / ajax to load those additional 10 items
 
user2416523
i m using codeigniter framework
 
user2416523
so the jquery.ajax() will be the option ?
 
You have to use ajax
 
user2416523
12:06 PM
can i use pagination and IFRAME on click the pagination the frame will load
 
maybe that could yelp you out?
 
@Uresh $.get(file, url_parameters, result_callback)
 
Don't use and iFrame :)
 
or, if you want to use $_POST, use $.post()
 
user2416523
yes
 
user2416523
12:07 PM
i know that method
 
($.get and $.post are shorthands of $.ajax btw)
 
user2416523
but i m fearing of loading that product div with data
 
user2416523
and css html
 
@Duikboot nice
why fear it?
just json your data
$.get will automagically convert it to an object for ya
 
user2416523
in the response i need to prepare all the html csss with product s
 
12:08 PM
and you can build your HTML on the fly with JS
 
'Iframes can have similar issues as frames and inconsiderate use of XMLHttpRequest: They break the one-document-per-URL paradigm, which is essential for the proper functioning of the web (think bookmarks, deep-links, search engines, ...).

If you're creating a web application, use whatever technique you want to (including frames, flash, applets, $whatever). If you're creating an actual, informational web page, stick to frameless HTML, CSS and unobstrusive JavaScripts and keep in mind that the page should still be usable with scripting disabled.'
 
^ not entirely true anymore though when you consider the HTML5 History api
but I guess that's why it says 'inconsiderate use'
lol
 
user2416523
so the jquer.ajax will be the last option for me to implement
 
@Uresh it's a good option, though it'd be wise to first implement a native pagination function
rather than directly going for jQuery
 
Indeed, make your loading first work wihout any ajax calls.
So you will have a page refresh but, if a user disables javascript he can have that one as a working one.
 
12:11 PM
i.e. if I visit your page
uresh.com/products.php

I'd want to be able to visit a second page of products
uresh.com/products.php?page=2

you'd have to support that first
 
user2416523
in Codeigniter its given inbuilt nothing to do so just 5 line of code and i know that load page on every next page called
 
user2416523
ohh.yaaa.thts also true
 
ok good
@Duikboot < this
 
user2416523
thank you
 
I really hate ajax personnaly :p
 
Anonymous
12:14 PM
@Duikboot why?
 
so basically:
1. implement pagination (i.e. make sure ?page=2 works)
2. show a button for JS users at the bottom of the page that lets them load more products
3. $button.click(function() {$.get("products-ajax.php", {page:2}, mySuccessCallback)});
4. function mySuccessCallBack(data) {console.log(data)});
 
Because I can never implement it properly right now Im also dealing with ajax problems.
 
@Duikboot maybe we can help
I <3 ajax
well $.get is not ajax necessarily, since I'm usually loading JSON rather than XML
let's call it AJAJ
but anyway
 
good morning \
 
hi Ninja
if you can't implement ajax good enough you should just drop the functionality altogether
ajax is overrated
there's no shame in loading a second page the regular way
 
Anonymous
12:16 PM

AJAX

If you hate jQuery & like AJAX, You are welcome :)
 
seems dead to me
lol
 
user2416523
@robbert we are developers so that we can understand that...but the clients are rigid
 
@Uresh you're the boss though
don't jump through hoops for your client
 
user2416523
i m employee
 
Anonymous
12:18 PM
@PeeHaa埽 too late : )
 
i try to only use ajax when required.. don't like to write code for something that has been done several years synchronous... lol
 
Anonymous
That doesn't make any sense
 
Anonymous
@ll
 
user2416523
use jquery leave ajax
 
@Happyninja agreed, there's usually no reason to have everything ajax
 
user2416523
12:19 PM
json is very easy
 
everything is easy once you know it
 
well
 
jQuery.get is just a wrapper for ajax calls @Uresh
 
user2416523
right
 
user2416523
oh....
 
12:20 PM
I have currently a frontcontroller wich call a upload scrpt
net.tutsplus.com/tutorials/javascript-ajax/… Im trying to impelment that one
 
user2416523
what is @robbert frontcontroller ?
 
@duikboot you mean?
 
Anonymous
Why use frameworks, without knowing a single thing about how the process works, behind the scene?
2
 
Front controler is like :
switch($page){
case page'home': blabalb break;
case page'details': bababa break;
}
So I have a button click in that one but now I have to catch that one with ajax
 
@phpNoOb ty
 
user2416523
12:21 PM
in framework its already given so why we use that swich case
 
@Duikboot so what's going wrong?
 
Ill make a pastebin of the part,
 
Anonymous
@Robbert seems, every-time I see you, I forget who you are.
 
@phpNoOb I'm new here, give it some time
@phpNoOb we talked yesterday about your array_search problem
 
12:23 PM
There you go.
 
Anonymous
Your suggestion did now work. I am taking back my points :P
 
@phpNoOb bullshit, I tested the code myself
 
Anonymous
I bullshit you not, it doesn't work
 
user2416523
@robbert so u r Student?
 
Anonymous
but, it's ok
 
12:25 PM
@phpNoOb run this:
$check = ["hi", "my", "name", "is", "phpnoob", TRUE];
$index = array_search(TRUE, $check, TRUE);

if($index !== FALSE) {
    echo "TRUE found in array at index ", $index;
}
in a new file
I guarantee you it'll output: "TRUE found in array at index 5"
 
what is the purpose of that?
 
(if PHP > 4.0.5)
 
Anonymous
You gave me in_array() last time
 
@Sam There is also a thing called common sense... — PeeHaa 埽 2 mins ago
 
Anonymous
now you changed it
 
12:26 PM
@Happyninja a discussion we had yesterday evening. phpnoob was looking for a way to check if a boolean value exists inside of an array. he needed the function to return the index
 
I receive always the following error : Uncaught TypeError: Cannot set property 'innerHTML' of null upload.js:20
 
@phpNoOb I literally copy pasted this code from last night
 
-><-
 
12 hours ago, by Robbert
@phpNoOb you shouldn't use in_array() then.. use array_search() http://nl1.php.net/manual/en/function.array-search.php
 
Anonymous
ahh, I must been sleep. It was indeed around 4:00 am
 
12:28 PM
@phpNoOb lol yeah, 3:00 am here
@Duikboot can you paste the code of upload.js?
 
I have this html :
 
so does an element exist that goes by the name of #response?
 
yes can it have a problem that I have 2 submit buttons in 1 form?
 
user2416523
no issue
 
nope, can't be the problem
I'll have a look
 
user2416523
12:32 PM
which method u use to submit data ? simple html/ javascript ?
 
i was tired of trying to figure out why my ajax upload thang wasn't working so i just create a function to capture url hash and used normal form to send my upload thang
so now when you upload something you come back at the exact point of where you were.
@Duikboot just do like e.preventDefault(); inside your button function
 
like
(function(e){e.preventDefault();});
 
user2416523
@Duikboot youe above url
 
It seems like when I added e.preventDefault(); it works oO
:P
but now I have to catch the files path when I submit :p
letstry
 
12:38 PM
the file path? why?
 
I have a multiple file upload and I have to write every path into a database field.
But argh this is the thing where it always goes wrong
the AJAX return always the whole page and that's not what I want
 
@Duikboot that's silly, not too sure why it's working. there's nothing wrong with the rest of the JS either way
@Duikboot so create a separate file that just returns a portion of your page
 
hmm
 
thats what AJAX is about
you just call a JSON with the raw data
 
$_FILES array yea
 
12:40 PM
and then you create HTML out of it using JS
 
you just need to figure that part out, it's not that bad ;)
 
So $.ajax({
url: ... needs to be a custom one?
only with the uploaded files
 
i haven't check it much but check that, it does make sense: phpro.org/examples/Multiple-file-upload.html
 
hmm
maybe I have to throw my current one away and use that one?
 
on your php side, if you do a var_dump, do you see your uploaded files in a $_FILES array?
 
12:46 PM
No just a sh*tload of undefined variables
so Im going to impelement the phppro.org example
Am I allowd having 2 forms in eachoterh?
 
undefined variables? if you mean you didn't defined them it's normal
no
everything inside the form tag is meant to be sent as one stuff. take it that way: it's the equivalent of serializing all input within form brace and send them to whatever action you decide
 
Almost there
 
Hey guys :)
anyone has any experience with php source code protection?
 
@dragon112 why protecting the source?
host it on your own server ;)
 
Never used it : showmycode.com
 
1:01 PM
@Duikboot i'm no big fan of security trough obscurity
 
I hope today my book is in my mail
Bought 'code clean' book :)
 
hmm ... this must be one of them best funeral songs (for lack of better way to categorize it) in this decade.
 
@dragon112 We used to use ioncube back in the days
 
user2416523
Never used it : showmycode.com ???????? Y
 
1:09 PM
This late in the game, is it safe to assume that Closure is an "implementation detail" that's here to stay?
 
@Bracketworks It's exposed for userland functionality in 5.4 isn't it?
 
@cspray Well, yes; all that binding fun.
Heh, reading for the win.
 
@Happyninja It's distributed with the hardware :)
 
> This fact used to be considered an implementation detail, but it can now be relied upon.
Nevermind ;)
 
Morning
 
1:16 PM
morning
 
MORNING
 
lies
 
(I didn't yell, I was just completing the sequence, class, var, const)
 
@Bracketworks rrofl
 
so, what's going on?
 
1:22 PM
PHP 7 was just released
 
> Unfortunately, this video is not available in Germany because it may contain music for which GEMA has not granted the respective music rights.
but i can play that on the guitar
 
@ircmaxell yay
 
1:24 PM
And Germany needs to fix its content rights. I thought the US had them screwed up, but man, Germany's worse...
 
@ircmaxell I love that.
 
I wonder if anyone ever named their kids Prince Adam
 
@ircmaxell Oh man, this day is gonna fly!
 
:-P
 
1:29 PM
I'm gonna see if I can do the whole thing.
 
@ircmaxell I'm not sure I wanna know what he's doing in that frame
 
:-P
 
hmmm
 
So, based on some of these videos, I'm guessing PHP 5.2 just got released?
@ircmaxell Sorry, I mean 4.2
Oh noez! register_globals is disabled! However will my codez work!?
 
1:36 PM
jizz i try to convert address to gmap iframe embed and it's messy
 
@ircmaxell if you have free tickets for phpbenelux and you don't know what to do with them. I would love to go :p
dutch conference
 
To Benelux? That already happened months ago...
 
I ment : phpconference.nl that one :)
 
@Duikboot that's DPC
 
Yeah, I ment that one. :)
 
1:49 PM
what's the name of the counting-pattern game where multiples of 3 and 7 need to be denoted by saying "bark" or "zap" or something?
Bah, nevermind; got it: Fizz-Buzz
 
are you looking for fizzbuzz?
 
Yessiree I was :)
 
Anonymous
hi
 
for($i=0;++$i<101;)echo $i%15?$i%5?$i%3?$i:'Fizz':'Buzz':'FizzBuzz';
make it shorter if you can :)
I've always seen it with 3 and 5 btw
 
stackoverflow.com/questions/16774163/… - and also, wtf is that last comment?
 
1:52 PM
@hank Thanks, I think I'll go for that one, seems to be pretty nice!
 
@hank Ah, 3 and 5; there was one that used 3, 5, and 7: Fizz Buzz Woof.
 
@hank random fun fact: if you'd hand in that to me I wouldn't hire you because it's so unreadable.
 
@Gordon thats pretty much the purpose of it :)
unreadable and as short as possible
 
@hank you mean pointless?
 
If I was the interviewer, I'd say "No modulus allowed"
 
2:01 PM
@Gordon Shortest possible fizzbuzz isnt pointless :(
 
@Bracketworks That's the follower of this Q stackoverflow.com/q/16773573
 
@hank it is for a job interview :)
 
unless you want to hire the candidates who refuse the task
 
@hank Any two or more primes work
 
2:07 PM
@Gordon Yea, I use a modified version of fizzbuzz as a part of hiring also
 
because
?
You want pretty lines? codepad.viper-7.com/extGlw
 
$i = 0;
$output = function ($txt, $force = false) use (&$i) {
	static $last = 0;
	if (!$force && $i === $last ) {
		return;
    }
	$last = $i;
	echo $txt;
};
for ($i = 1; $i < 100; $i++) {
	if ($i % 3 === 0) {
		$output("Fizz", true);
    }
	if ($i % 5 === 0) {
		$output("Buzz", true);
    }
	$output($i);
	echo "\n";
}
stupid viper7 mixing tabs and spaces
 
@hank and you take those that hand in the shortest and most unreadable or those who refuse it?
 
I dont understand what part of wanted to write the shortest possible fizzbuzz possible that was hard to understand.
 
2:15 PM
Does anybody know if I can use $mail->Body in phpmailer more then once? I mean if I want to add on to the body can I simply declare a new $mail->Bodytag or do I have to add the entire body in one go...?
 
What's up guys, everyone having a good weekend?
 
Is there a way wrinting this shorter too?
 
/me is off for the day, later all
 
(3 day weekend for me ;) )
 
Goodbye @ircmaxell
 
2:19 PM
@hank wanting to write that as a personal challenge is fine. but making that the basis for a hiring decision is just odd given that you dont want people to write messy unreadable production code.
 
never wrote that..
 
@hank but that's what I was asking you :)
 
Is there one word that names both Interface and Class well?
 
@hakre signature ?
 
2:38 PM
You want to submit your proposal to the presumably awesome #froscon PHP room: http://kore-nordmann.de/blog/0107_php_at_froscon_2013.html
 
Q : I have a php upload script for 1 field currently.
But I have about ... 5 upload fields
Can I put then in a for loop? to create and validate them?
 
@Ocramius an Interface is a signature. A class is a signature - It's more like has not is. But that might work.
 
Will it work if I wrap for($i=1; $i<5;$i++){
around it?
 
2:51 PM
Try it and you'll know
 
I tried this :
But it seems it's not working / uploading.
 
@Duikboot any errors ?
 
No errors.
 
($_FILES['file_upload."'.$i.'"']) this is not gonna work pal.
 
Why not?
do I have to remove the dot? after upload?
 
2:56 PM
Do you mean you are getting an entry called file_upload."1" in the $_FILES array?
It seems to me you would want to do: ($_FILES['file_upload'.$i])
 
I removed the dots' yes idd
indeed*
 
Try again
 
I want to upload the files in the follwing fields : filie_upload1 filie_upload2 filie_upload3 filie_upload4 filie_upload5 ( I now removed the dot but only the last file appears in my session)
And it's not writing to the directory it seems. But I have no errors.
 
Did you change it in every place you called the $_FILES array?
Well I'm off, good day to all of you
 
Goodbye thanks for the tips @dragon112. :)
 
@Bracketworks RFC required
 
@ji
@Jimbo I wasn't rep whoring, else i'd answer it!
 
@Farkie Lol, answering poor questions is kinda repwhoring
 
he still needs help :P
 
It's generally agreed that people who ask for help without putting in some research (i.e. basic debugging, for a start) don't get other people to do the work for them
 
3:06 PM
I wasn't doing any work, essentially asking him for more info
 
@Farkie I noticed you're upping your points fast mr farkie!
 
Hell yeah
catching you
 
I was never arsed really, hence my questions are far apart and in-depth
 
:D
I'm 10th this week apparently
perfect for you
 
3:09 PM
@Farkie Nice find!
 
Easy reps:
- Search the docs even if you don;t know a single thing about the subject
- copy past and include some text
- voila got 13 ups http://stackoverflow.com/questions/13007288/find-substring-in-the-string-in-twig/13008332#13008332
 
I got one of those yesterday
4
A: A formula to find prime numbers in a loop

FarkieHere's a little function that I found: (http://icdif.com/computing/2011/09/15/check-number-prime-number/) Seemed to work for me! function isPrime($num) { //1 is not prime. See: http://en.wikipedia.org/wiki/Prime_number#Primality_of_one if($num == 1) return false; //2 is prim...

 
Sometimes I really don't understand the community
You post an elaborated answer you get 3 upvotes
You post an obvious answer short answer: you get 7 upvotes
 
I'm on -10 today, lol
 
@HamZaDzCyberDeV More people are gonna read the short concise answers so you get more views
Most people are not gonna read short books on the Internet
 
3:13 PM
@cspray And that's why most people fail - you set yourself apart by putting the effort and research in.
 
@Jimbo Well, that's just the way it is. Passionate dedication is a minority thing I believe
Not majority
 
It is, unfortunately :( (or fortunately, depending on how you look at it)
 
There's also value in being concise as well
 
Regardless of how passionate you are on the subject
 
3:15 PM
@cspray Yeah I know ... But it's kinda sad
@Farkie I've coded something in PHP by using Sieve of Eratosthenes to generate primes from 2 to n. Maybe I'll drop it later when I'm on my pc ... It's soooo fast :D
 
Seriously bored this weekend, cba with SO, cba with any video games, cba with learning symfony
 
@Jimbo go do some workout :D
 
Things stop being fun when you start thinking about them so logically - I have x amount of time to devote to this, and then I will complete x amount of it, meaning I will have to do it for x number of days to complete it
@HamZaDzCyberDeV Probably, need to stop being so lazy too x)
 
@Jimbo Prepare for ZCE
btw, coming to conference?
 
phpnw/
 
3:20 PM
yeah
 
the full thing?
 
yes
 
can't afford tickets, again
 
Become helper
Free ticket :P
 
Do I get to see the full conference as a helper?
 
3:21 PM
no, 1 track
 
=[
 
well, 1 track when you are on, but you do alternate, so you get to see what you wan t on the ones you have off
 
Hmm, what are the girls like at PHPNW conferences?
 
..pretty sure you have a gf
 
Pretty sure I asked a legimate question
 
3:22 PM
haha
They are lovely!
 
Wait, as in <woman who must not be named who wrote that PDF> lovely, or otherwise
 
she'll be there
Also, it's the meetup next tuesday
and, the tickets atm are only £95 for the weekend..
lol @ham
@HamZaDzCyberDeV
 
@Farkie what ?
 
that PHP-Fu
that's certainly one way to do it
 
lolz
I just want to show there's another way of doing things :D
@Farkie They asked for a short answeeeeeeeeeeeeeer !
 
3:30 PM
hmm... does anybody have an idea on how to build a sandboxed php environment like 3v4l3d?
 
purrfect
 
Fancy going somewhere for lunch this week @Jimbo
 
@Farkie Why not, anywhere in mind
mystery tea house is nice
 
3:45 PM
If they can do it in half an hour, sure :P
No Adrian or Heather this week, quiet one!
 
Later people !
 
@Farkie Oh, so because you're usual buddies aren't there, you use your second reject? FU :P
 
Pretty much
you never come on skype :(
 
Then no ty
I know keep forgetting lately
 
I'm only joking :P
 
3:47 PM
Yeah, you're not though ;)
 
I'm not! If you came on Skype once in a while, I'd ask :P
 
What about the russian guy you got?
 

« first day (954 days earlier)      last day (4008 days later) »