« first day (799 days earlier)      last day (4152 days later) » 

12:08 PM
what ?
 
I have in a php $var that info
$var = "sendRPCDone(frameElement, 'avic', new Array( 'avicii levels' , 'avicii' , 'avicii superlove' , 'avicii silhouettes' , 'avicii last dance' , 'avicii fade into darkness' , 'avicii nervo youre gonna love again' , 'avicii dancing in my head' , 'avicii level two' , 'avicii levels skrillex remix' , 'avicii blessed' ), new Array(), new Array());
";
I want to print the information in <pre></pre> tags
example: <pre>avicii levels</pre>
<pre>avicii superlove</pre>
<pre>...</pre>
 
@MikelGarcesEtxebarria PHP != JavaScript
 
I know
and this is php
 
No it is not :)
 
12:14 PM
Monring all
 
@PeeHaa morning
 
@MikelGarcesEtxebarria array isn't a class
Nvm :)
I'm not sur what it is you want :)
 
@MikelGarcesEtxebarria prof 3v4l.org/Kd0HK
 
lol
 
@PeeHaa :D
 
12:18 PM
anyone can help me?
I'm talking about php string
 
@MikelGarcesEtxebarria about php string yup...
if i can i will
 
5 mins ago, by PeeHaa
I'm not sur what it is you want :)
12 mins ago, by tereško
what ?
 
ok, let me explain
imagine that you have the next php string
 
Wow. Github has been down for a long time :|
 
$var = "sendRPCDone(frameElement, 'avic', new Array( 'avicii levels' , 'avicii' , 'avicii superlove' , 'avicii silhouettes' , 'avicii last dance' , 'avicii fade into darkness' , 'avicii nervo youre gonna love again' , 'avicii dancing in my head' , 'avicii level two' , 'avicii levels skrillex remix' , 'avicii blessed' ), new Array(), new Array());";
PHP not javascript
 
12:25 PM
lol...stackoverflow.com/questions/14010777/… that dude included 2 jquery 1.7 and 1.5 than removed 1.5 and include 1.7 again than removed both 1.7 ... and now telling not working ....
 
and now in PHP I want to read the string and per each data inside new Array, response with <pre>data</pre>
example: <pre>avicii levels</pre>
<pre>avicii superlove</pre>
<pre>...</pre>
 
please format code properly by pressing ctrl+k
 
It might be possible with regex, but it is pretty damn hacky. Where is the data coming from? Why does the string contain JS? DO yu have the original data?
Jo @DaveRandom
 
Hey hey
 
@MikelGarcesEtxebarria , please stop repeating the same crap
you question makes no sense
 
12:27 PM
 
I havent the data
 
:-D
 
and it will not make more sense it you repeat it for 5th time
 
@tereško zzz
I will repeat all the times I want
 
@MikelGarcesEtxebarria Please use array literals instead of new Array(); (i.e. write [] instead)
 
12:28 PM
if people can understand my question I will repeat
@DaveRandom the problem is that I'm receiving the data in that format :(
 
@MikelGarcesEtxebarria OK well tell whoever is sending you the data to use JSON and/or JSONP instead, because that is just an insane way to transmit data.
 
I cant read in any case? :(
i this format?
in*
 
You can, but you are really talking about writing a Javascript parser there
(which fairly obviously is not a trivial task)
 
I think that I have to detect where is New array('
save the information in a new var
and then read again the new var replacing ' ' with <pre></pre>
 
Well it's fairly easy to write a regex to extract the data from that specific string, but if there is even a minor deviation it would break...
 
12:34 PM
always is the same structure
 
OK, but what about the second two arrays - will they ever have any child elements? Will you ever have any strings with escaped quotes in them? Will the enclosing function name ever be different? What about the name of the variable? Will there ever be any data types other than strings?
 
the other arrays are not in using
I only need to take that info
new Array( 'avicii levels' , 'avicii' , 'avicii superlove' , 'avicii silhouettes' , 'avicii last dance' , 'avicii fade into darkness' , 'avicii nervo youre gonna love again' , 'avicii dancing in my head' , 'avicii level two' , 'avicii levels skrillex remix' , 'avicii blessed' )
of the first new array, always
 
@MikelGarcesEtxebarria OK, well if that really is true, can't you just substr() the beginning and end off, and then you'll be left with just a collection of quoted strings, which are (relatively) easy to parse.
 
@PeeHaa lol.... can anyone send me to mission marsh
 
Use cURL instead of classic PHP functions, it solves all the problems — Martin 4 mins ago
NO.
 
why
$firstpos = strpos($var, "(",2);
 
@DaveRandom its should nooooooooooooooo.com ..lol
 
takes me the first ( and not the 1
and not the 2?
 
12:58 PM
@MikelGarcesEtxebarria Because the 2 you passed is a character offset, not the second occurence. If you want to do that, try strpos($var, '(', strpos($var, '(') + 1)
 
strpos($var, '(', strpos($var, '(') + 1)
strpos($var, '(') + 1)
 
Mmhmm, that will get you the position of the second occurrence (assuming there is one)
 
@Charles fixed in all videos but that one
 
where am i O_O
 
1:25 PM
@Fedcomp Stackoverflow PHP chat. It's generally best if you sober up before turning your computer on. ;-)
 
heh, awesome. My friend send me link about chat.stackoverflow.com, never heard about this place.
*sent
 
the long standing question "how do they get here" has been answered
4
 
lol
0
Q: phpPowerPoint class - how to change font in pptx?

KalregI need to dynamically create ppt files and found phppowerpoint library. Unfortunatelly there is no documentation. Although there is documentation link on its homepage and folder in zip file i downloaded it doesnt provide any help in learning library. It is first time I met something like this. An...

"Please read my error message for me?"
 
@timpost Why did you edit those tags back in?
 
1:40 PM
good mornings :)
 
How exactly has this one survived?
 
@PeeHaa "And this is my upload script (from w3 schools):" :-/
 
Yeh I love that, plus both of those answers appeared after he responded to my comment saying "thanks, it works now"
-3
Q: ATTENTION! this is not a constructive but please don't close it friends

rupoJSI am a new programmer i really like to write codes and solve puzzles.I started with C and C++ but now I am moving to PHP and I am liking it more,and my question is "should I use PHP to solve the problems of spoj and codechef or should I stick with C and C++".I am really confused at this ...

 
:-D
 
lol, even Jon Skeet got in on that action
 
1:43 PM
oh! question closed by Jon Skeet! The OP may live happy now
 
> For the collation, use whatever you like. I prefer latin_general_ci, but if you want unicode you should use a UTF8-compatible collation.
 
oh , it's that rep-whore again
 
stackoverflow.com/questions/13955264/… ... localized or not a question
 
2:09 PM
hi everyone
 
@GeorgeLim Hello
 
hi @GeorgeLim
 
ehh .. gonna go an play some SPAZ
 
@tereško SPAZ?
 
i have a question to ask about php
 
2:10 PM
Ah indie game
 
hi peehaa
@Pee
sorry i am the first time using the chat here
 
np. Please see our room description over at the top right
 
the next Parents Helping Prents meeting will be on January, 3rd
 
ok thanks. now i understand
$q = " SELECT * FROM main WHERE id > " . $_GET["id"]. ";";
this is a query from my one of the company i applied
they sent to me ask me to check it to find out the mistake
//must use mysql_query function
// the query doesnt need the larger than sign.
// the $q is a redundant, it can be written into
// $query = mysql_query("SELECT * FROM main WHERE id = something!!);
// or $query = mysql_query("SELECT * FROM main WHERE id = {$_GET["id"]}); from user input
below with double slash is my answer for that
 
@GeorgeLim It's vulnerable to SQL injection
"//must use mysql_query function " is just terrible, because it is deprecated
 
2:14 PM
sorry i am just starting to learn
 
@PeeHaa lol...you are smart ...
 
dont have to give me full answer i am trying to learn as well
 
and i missed so many close vote ..:)
 
Look those two things up and start learning
 
hello
 
2:15 PM
because my reputation in stackoverflow is getting lower and lower
 
hiya @dyelawn
 
I freaking hate OSX
 
@ircmaxell why?
 
@ircmaxell Welcome to the club
 
why is vulnerable to sql injection?
@PeeHaa ?
 
2:16 PM
You didn't want a full answer :)
 
oh ya thanks
 
i'll find out for that
 
^ quick before it lays eggs ;)
 
@PeeHaa lol...that why i even not tried once ...
 
2:17 PM
@PeeHaa what's wrong with it? asking out of genuine curiosity; i don't know enough about diffs between OSes to have an educated opinion of any, but would like to know more
 
@dyelawn I've never used a worse OS in my life. The number of beachballs I get is ludicrous...
 
@ircmaxell so from a user standpoint more than a development standpoint?
 
correct
 
49
A: SQL injection that gets around mysql_real_escape_string()

ircmaxellThe short answer is yes, yes there is a way to get around mysql_real_escape_string(). for certain obscure edge-cases The long answer isn't so easy. It's based off an attack demonstrated here. The Attack So, let's start off by showing the attack... mysql_query('SET NAMES GBK'); $var = mysql_re...

 
@PeeHaa i was wondering if the code i posted just now i correct or not because there is a greater sign , because the query equal to something
$q = " SELECT * FROM main WHERE id > " . $_GET["id"]. ";";
my solution is $query = mysql_query("SELECT * FROM main WHERE id = {$_GET["id"]});
 
2:23 PM
@GeorgeLim try
' or '1'='1' -- '
' or '1'='1' ({ '
' or '1'='1' /* '
 
@GeorgeLim It is correct in the sense that it wouldn't throw errors at you. It is terrible though in the sense that I can do anything with the data inside your databses I want (or worse depending on setup)
a.k.a. SQLi
 
@ircmaxell what is 𖠂 in '𖠂' OR 1=1 /*' LIMIT 1 ??? (i know its square )
 
It's a non-renderable character
 
@GeorgeLim they're likely testing to see if you know how to prevent sql injection.
 
@ircmaxell than you mean we also need to check this ?
@dyelawn check this
SQL injection is a technique often used to attack a website. This is done by including portions of SQL statements in a web form entry field in an attempt to get the website to pass a newly formed rogue SQL command to the database (e.g., dump the database contents to the attacker). SQL injection is a code injection technique that exploits a security vulnerability in a website's software. The vulnerability happens when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and unexpectedly executed. S...
 
2:28 PM
No
 
so there is nothing wrong with the greater sign but why most tutorial i watched on youtube use equal not the greater sign
 
The non-renderable product would only happen in the case of this injection
 
@NullPointer ...? i know what it is.
 
@dyelawn than why are not sql Attack ?
 
@NullPointer no comprende
 
2:30 PM
@DaveRandom $finalpos = strpos($var, ')', strpos($var, ')') + 1);
it takes till the last )
 
@GeorgeLim neither one is incorrect, it depends on what you want. say the "id" refers to a news story. if you wanted all news stories after a given news story, then you'd want ones with an "id" greater than "id"
 
not the second :(
 
if you wanted to get a particular story you'd want one where "id" equals "id"
that's why i think the employer is looking for you to notice that the problem is the potential for sql injection
 
Thank for that. i am trying to figure out how to prevent the SQLi
 
@GeorgeLim that's not SQL injection
 
2:36 PM
now i understand the greater or smaller sign. it is actually return something that is greater or smaller than the user input $_GET["id"]
i know i mean prevent someone using SQLi to attack the database
 
that's it. I quit. Fuck OSX
 
does anyone have a good reference for project workflow? step-by-step instructions, including decision-making processes for things like selection of frameworks
 
@PeeHaa lol.'---vvvv
1 min ago, by George Lim
Thank for that. i am trying to figure out how to prevent the SQLi
 
@ircmaxell can i ask what you're working with that's giving you so much trouble?
 
anything wrong @NullPointer ?
 
2:38 PM
@GeorgeLim noop
 
Doing something CPU intensive... And that's where OSX fails hard
 
mvc in web development is worst think i tried
 
@Baba another discovery of canonicals dark side: t.co/4SRZOw3x
 
2:56 PM
when should a self-authored symfony2 bundle live in the vendor directory, and when should it live in the src directory?
 
Minimum Reputation Filter Bookmarklet r2: javascript:var hideLower = 1000; (function(exp, ctxt) {var item, coll = [], result = document.evaluate(exp, ctxt || document, null, 5, null);while (item = result.iterateNext()) coll.push(item);return $(coll);})('//span[@class="reputation-score" and . < ' + hideLower + ']/ancestor::div[contains(@class, "question-summary")]').hide();(function(a){a.hide(); setTimeout(function(){a.show();},1);})($('#mainbar .cbt'));
Yet it's still not clear why it works :)
 
:(
 
@hakre Thanks. You just made me puke a little
 
@PeeHaa well if you get paid by LoC, that is very good practice :)
 
:P
 
3:49 PM
^ let's not train new users to help vampires.
 
hey is there any open api for accessing currency conversion info?
*hey all :D
 
morning
 
Yes, yes it is.
 
@NikiC Guten Tag
 
Anonymous
3:54 PM
morning btw
 
Anonymous
@all
 
Thanks @TheCOMPLETEPHPNewbie :)
 
Anonymous
no problem
 
user1125394
@igorw Both Glassfish Java or python SSE servers fail at some point with Too many open files.
 
3:57 PM
so i am sure there are loads of people who might have thought this.. or there probably is a wiki article about this? how do they manage to keep all the conversions *nice* so that there can't exist a cycle which if followed simply generates money for you? i mean say 1 A = 2 B, 1 B = 2 C, but 3 C = 1 A
i know i probably shouldn't be asking here but .. :| :D
 
@cyril increase ulimit
 
user1125394
yes but it would be great if it didn't crash completely
 
4:29 PM
morning @Robik @PeeHaa
whats up?
 
Anonymous
1
A: using PDO instead of mysql_*

The COMPLETE PHP NewbieThis is better, as it can catch exception if something goes wrong (so, I have been told) try { $conn = new PDO('mysql:host=localhost;dbname=mydb', 'root', 'test', array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); } catch(PDOException $e) { ec...

 
Jo @NikiC. Nothing much. Trying to finish up my html/php upload service, drinking beer. The usual :)
 
Anonymous
hmmm...
 
Anonymous
@PeeHaa was that you?
 
Hi all ...
 
4:34 PM
@PeeHaa Following the Balmer rule on alcohol and coding, eh?
 
The Ballmer peak rule is great ... sometimes :)
 
user1125394
see where Microsoft is now...
 
@Charles I'm trying to make the peak last as long as possible. And when it's done I always have my unit tests to tell me so :)
 
Windows releases are basically following the same rules that Star Trek movies followed. Every other release is pretty darn good, while the ones in between are flawed and unwatchable.
 
$a = [ @Peehaa , @NickC , @Jack , @cyril ];
foreach(new InfiniteIterator(new ArrayIterator($a)) as $u)
{
	printf("%s hi",$u);
}
 
4:38 PM
Multitasking with PHP? Has Christmas come early? =D
 
hola @Baba
 
user1125394
@Baba could work but in Js, hi
 
@Baba throw new BabaSpamException();
 
@PeeHaa .... my main man
@cyril it would work if defined :)
@Jack ... lol
 
@TheCOMPLETEPHPNewbie Was what me?
 
Anonymous
4:40 PM
I know it was you. But, never mind. I am too tired for a fight. @PeeHaa
 
@TheCOMPLETEPHPNewbie WTF are you talking about?
 
o.0
Can we place bets yet?
 
@Baba Yo yo. How's life?
 
Anonymous
Forget it man.
 
@cyril it works perfectly ... eval.in/5166
it it suppose to even work ??
@PeeHaa not bad
lol
@PeeHaa are you still going to Germany ?
 
4:43 PM
@Baba Been there. Done that. Last weekend
 
Yawn ... time to sleep ... adios!
 
later @Jack
 
@PeeHaa wow .. any beer feat
@Jack later ...
 
Beer, Gluhwein and tequilla
 
user image
4
 
4:44 PM
@Baba For that I have to wait another year :)
 
@PeeHaa cool :)
@PeeHaa thinking of going next year too
 
@Baba lol
@Baba The defines are useless ;)
@Foo in PHP is the same as "Foo", unless the Foo constant is defined
 
@NikiC really ....
let me give it a try
@NikiC wow
 
Anonymous
@NikiC Not entirely.
 
How did that happen ???
 
4:47 PM
@Baba Try just Foo (without the @) and make sure you have notices enabled
Then you'll understand ;)
 
Are you kidding me @NikiC
Notice: Use of undefined constant Peehaa
 
Anonymous
Constants are used for predefined functions as parameters which may be only integers or as return values which may be only integers. These contants are predefined as got useable names. As an example the function getimagesize returns some information about an image. The type of the image (png, jpeg, gif, ...) is encoded as an integer. The value 1 is for gif and the value 4 is for png. To check agains the type you could write the following code.

http://tut.php-quake.net/en/constants.html
 
@Baba There should be a bit more. Like Use of undefined constant PeeHaa - assumed 'PeeHaa'
 
@NikiC yeah .. that would be better ... but really i never knew PHP would convert the value to string
 
PHP has many dirty secrets ^^
 
4:50 PM
lol
wow
@NikiC there is a regex question have been wanting you to see .. since you are the regex god
6
Q: PHP Filter text for banned words

codefreakWe have a C2C website and we discourage selling branded products on our website. We have built a database of brand words such as Nike and D&G and made an algorithm that filters product information for these words and disables products if it contains these words. Our current algorithm remove...

 
Oh we can stop you right there ... that's not a regex problem :)
Sorry, not sleeping yet
 
@Jack u need to see what @NikiC has done with regex
he can practically write anything with regex
 
Anonymous
@tereško What the hell is wrong with you man?
 
user895378
custom tokenizers/parsers FTW ;)
 
@Baba What has he done?
 
4:54 PM
Man, I was totally expecting that to be a clbuttic thing but just detecting it avoids the issue. Love that iterator, @Baba!
 
@Jack he has open my eyes to regex
@Charles thanks
 
@TheCOMPLETEPHPNewbie this "Remember, catching an exception is a bit like the or die(mysql_error()); part of sql connection." is one of the most retarded things i have read today
 
Anonymous
@tereško I said they are a bit like die() constructs, because they in this context, they echo out a message as a last resort if query fails
 
you have no idea what exceptions are ...
 
Anonymous
I was trying to make him understand what the exception was there for.
 
4:57 PM
Man, am I glad I didn't go to sleep yet ... grabs some popcorn
 
s/or die\(/or throw new DeveloperIsAnIdiotException(/g
 
how can you make someone understand what exception are , when you evidently have no idea yourself ?!
 
user1125394
$(".avatar img").each(function(i, data){$("#input").val($("#input").val()+' @'+data.title);})
 
user1125394
ping bomb
 
Anonymous
Anyone: this stackoverflow.com/questions/14012449/using-pdo-instead-of-mysql/… is the cause of our argument, apparently @tereško downvoted my answer.
 
4:59 PM
@TheCOMPLETEPHPNewbie That's not apparently, he said he did.
 
cry me a river
 

« first day (799 days earlier)      last day (4152 days later) »