« first day (625 days earlier)      last day (4326 days later) » 
00:00 - 18:0018:00 - 00:00

6:00 PM
@NikiC ( i am using php 5.3.8 version) next what to do?
 
find the right dll :)
if it doesn't exist, then you're screwed, because you would have to compile the ext yourself
 
@NikiC :-P
 
Would installing it through pecl help? Does it do any kind of version-matching voodoo?
Or does pecl just install the latest version regardless of what's installed on the machine?
 
pecl works on windows?
 
Hi friends.. I am getting this error "Deprecated: Function eregi() is deprecated in" in these lines


function verify_valid_email($emailtocheck)
{
$eregicheck = "^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,4}\$";
return eregi($eregicheck, $emailtocheck);
}
 
6:05 PM
@NikiC Never thought to ask :x
 
Thanks am checking it..
But am not a programmer.. Just using a script and getting this error.. can you tell me how to modify the above code
 
ask the developer of the script to update
 
@NikiC @MikeB thank you very much for spend your golden times.!!!
 
woohoo golden times!
 
@Desizner It's PHP... There's a function for that
And evening all
 
6:09 PM
haha
 
Thanks friends.. I will check on that..
Thanks @MikeB @Krish @PeeHaa
I tried with preg_match function seeing the SO.. and got it workign after changing the line to this


return preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i",$emailtocheck);
Thanks once again for the support friends..
 
Ahh i see "FILTER_VALIDATE_EMAIL" in there.. i could use that i guess
Am i correct @PeeHaa ?
 
@Desizner yes you are
 
hello
i wana to creat a page web with pictures
i dont know how can i do it , saving my picture en database
any help plz
 
6:22 PM
@bengika Why do you want to save images in a database?
I see this in tons of questions.. mainly from inexperienced users and I always found it odd because (imho) saving/loading images from a blob field is somewhat advanced
Where did you get this idea?
 
yes
im newbie
en php
i dont know so many think
so
i wanna to creat a page web with product
for to sale products online
you know what i mean
sorry for my bad english
realy i dont know from where i have to start, if your can help me plz
 
@WhomeverCreatedThePhpDocbookFormat Screw you. You wrapped most of the refsect1s in a para tag? Do you know what you have done? You have caused p.para tags to be generated in HTML that have no content but whitespace. This means they are not :empty. Not cool, man, not cool.
 
@NikiC Have you worked with the PHD system?
 
@LeviMorrison nope
I never go further than running configure
Ask bjori. I think he's mainly doing phd
 
6:38 PM
The code is well documented as far as PHP stuff goes.
Unfortunately, there is no system overview that describes how it fits together.
 
Well, its part of the PHP project so you should be really happy that "[it] is well documented as far as PHP stuff goes"
That's pretty exceptional
Normally PHP does not bother with comments or docs ^^
 
@bengika But where did the idea of using the database to store images enter your mind?
And he's gone :( - I'd really like to know where novice users get the idea that it's a good idea to store images in a blob field
 
@MikeB I hear you like to store stuff. What storage??? I haz a databaze!!
 
@MikeB Databases are cool
Especially if ther are NoSQL
Oh, and obviously the coolest thing ever is storing image blobs in a table using the MEMORY storage driver :P
so they are fast
 
@NikiC lol
Back in the day I used a database to store many GB of images because they didn't count against my hard-drive usage (shared hosting)
 
6:48 PM
You can write a PHP script that reads the array and generates questions from it. If you're a developer, this is known as "your job". — GordonM 2 hours ago
 
@MikeB lol
 
@MikeB Loophole abuse FTW
 
Q: pokit.org/get/img/cc3b7c31f677f2316b709b4d95684ec6.png what is a good way to specify $cookie from outside if I don't access this class directly, if you know what I mean...
 
Best repo I've found so far on github: github.com/tinkertim/dbad
 
7:12 PM
Not a specific question but I'm interested in how you guys developed your programing skills. What did really helped you getting advanced? What is your personal "must do" advice for us beginners? Feel free to answer and thanks for your attention.
 
@ycelik Since you asked:
It helps to be here in chat. Or even better share some public code here and prepare yourself for a shitstorm when you are doing it wrong ™ :)
3
But serious: best way to advance in programming is by doing it
And maybe make some errors while you are at it
 
and accept criticism manly
 
@ycelik There are also some nice books out there
 
@PeeHaa this sounds really good.
 
@ycelik Do you have a github account by any chance?
 
7:18 PM
@PeeHaa yes dude: github.com/ycelik
@PeeHaa but there are no repos on my github
 
Nope I see it :(
:P
How come? You're a student. You have soooo much time ;)
 
@PeeHaa Dude I'm on a dual study program means I'm working 3 months in a web agency and studying 3 months at the university.
 
@PeeHaa lol
 
@ycelik You learn by doing. Pick a project of some sort and figure out how to build the project you selected.
 
The best way to learn is to teach. The second best is to fail
 
7:27 PM
@ycelik This chat, definitely ;)
 
@GordonM Do you have something in mind which is realistic and other people could benefit from? Some cool projects that are outdated because of no more support by the developers for example. I dont like the idea to do something useless. At least others should profit.
 
wow, that was painless
installed CentOS as the only OS on the new mac mini
and I unfollowed Jeff from twitter
 
@ircmaxell you even had him followed?
 
yeah
 
@ircmaxell Jeff who? And why?
 
7:38 PM
Jeff Atwood
 
And why?
 
Because Jeff Atwood
 
Also see:
Jun 29 at 17:26, by ircmaxell
it took all I could muster to not say Go F*#%$ Yourself Jeff...
 
Oh, starred message.
Checks context
 
Context is yet another PHP rant of course :)
 
7:40 PM
Context is codinghorror.com/blog/2012/06/the-php-singularity.html and other writings by Atwood
 
Well, the only certain things in life are taxes and PHP rants.
 
@minitech true that
 
@minitech may I tweet that?
 
@NikiC Sure :D
 
Jeff Atwood, where do I know that name?
Oh yeah, Mister Fizzbuzz.
 
7:45 PM
Hey, I have a great name for a PHP library (or something) but no clue what said library (or something) should do.
Anything still missing out there?
;)
 
Working lib first, then name. This isn't Dilbert :)
 
@GordonM Nuh-uh. Whenever I go make something, it's already there.
 
(and yeah, I know he's kind of a big deal regarding StackExchange, but to me he'll always be Mr. Fizzbuzz)
 
Wait, did you just say this isn't Dilbert?
 
You could always come out with an outdated database abstraction that's similar to the cowbelljs just for shits and giggles....
 
7:50 PM
class Site5_WebSocket_Application_Site5 extends Site5_WebSocket_Application_Application
oh Zend...
 
@minitech Yeah. I just got the image in my head where they're having a huge meeting about what they're going to name their next product and they hadn't decided what the product would be yet, let alone design or develop it.
@webarto That's not a real class... Then again, zend...
 
@GordonM :D
 
I love using Futurama characters for server names
 
I remember the first place I worked as a web developer, one of my coworkers had worked in a place where they named all their servers after pokemon.
 
7:56 PM
They'd named their mail server "jigglypuff", and suddenly discovered it was getting blacklisted because the downsteam filters assumed it was from some porn spam domain.
 
hehe
 
@GordonM I can't believe I've nailed it from first time pokit.org/get/img/5fc97a1e431f00696cc7fb532b0160b9.png , it's ZF1, I see that ZF2 makes more sense with everything...
 
My last job, I had 3 naming conventions
colors for windows servers (White, Orange, Yellow, etc), metals for linux servers: platinum, gold, silver, steel, etc, Saturn's moons for VM hosts (Dione, rhea, etc)
 
haha
 
@GordonM Oddly enough, said awesome name is a Pokémon.
I feel a little embarrassed now.
 
8:00 PM
I don't run any windows servers or VM's really -- but all my Linux servers are named After Greek Gods (Ares, Artemis, Demeter, Hades, Zeus, etc..)...
 
My personal stuff uses Futurama characters for personal servers and Family Guy for stuff I do for other people
bender, fry, zoidberg. And then stewie, meg, peter
 
a fraction of servers @ Site5 ... tower, warden, dunsfold, manor, cedar, milton, summit, rhodope, nammu, belong, orestes, your, delbin, rona, alma, maple , greenland, king, moray, hagar, cassima, cordoba, nambe, kiver, are, kenton, birch, acacia, weston, ormond, arthur, arvon, dartmouth, kelross, liber, lucerne, oakford, anson, celia, ganesha, gauri, granby, hanuman, kali...
 
@PeeHaa NSFW, but
 
My computers are named based on inconsistencies.
 
@ircmaxell Meg must get DDOS'd every, like, 12 seconds.
 
8:04 PM
(I would say something about VMs or servers, but I don't have any.)
 
@GordonM Nah, that one is shut down now
 
Mine would be the HTC desire. I will never desire a HTC again.
Nor will I ever touch a 2 year contract with a barge pole again. I'll stick to rolling contracts and/or PAYG and just buy the phone myself, and put it down as a hard learned life lesson.
 
I'm new to the idea of sanitization. Is it enough to wrap all retrieved variables in mysql_real_escape_string
 
sanitization ^^
 
8:18 PM
you shouldn't be using mysql_* anything
 
aye
 
@user187680 No
 
is there a common quick guide on this?
 
look more toward PDO or MySQLI
 
8:18 PM
605
Q: Best way to prevent SQL Injection in PHP

Andrew G. JohnsonIf user input is inserted into an SQL query directly, the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO table (column) VALUES ('" . $unsafe_variable . "')"); That's because the user can input s...

2
172
Q: What's the best method for sanitizing user input with PHP?

UltimateBrentIs there a catchall function somewhere that works well for sanitizing user input for sql injection and XSS attacks, while still allowing certain types of html tags?

 
Thanks. I'll go read that.
 
read the first one, skip the 2nd...
 
@NikiC :)
 
@Justin why skip the second?
 
@user187680 because it doesn't give you information about the deprecation of the mysql extension as where the first one does and gives you examples for both PDO and mysqli
 
8:22 PM
I've been thinking about a syntax for varidic functions recently
 
@Justin Yet it mentions the view-side of input-escaping. The mere mention of mysql_real_escape_string() turns you off to the entire post?
 
My current favorite is using the syntax function query(string $query, ...$params). With the ability to have typehints on them too, so query(string $query, string... $params) would work too.
Do you think that's okay?
 
@NikiC In PHP? func_get_args isn't enough?
 
mysql_* answers that question @MikeB being that the mysql extension is deprecated, you'd logically conclude that mysql_real_escape_string() is deprecated too
the first one is also 2 years NEWER than the 2nd one, and thus has more accurate and updated information to todays standards (even though it's 2 years old)
 
I mean, you can't even do checking for non-classes yet, so...
 
8:24 PM
Okay well that first article was way over my head (eek).
 
Oh, the first one -- is also the community wiki -- which means -- it's updated periodically...
 
@NikiC I've also been thinking about a syntax for that. -> Inconclusive
 
@Justin The questions aren't duplicates of each other.. one is focused on escaping queries, the other is focused on escaping user-input in the view-layer.. the latter simply mentions mysql_real_escape_string() in passing
 
I like C#'s parameter arrays best, but it's decidedly un-PHP-like.
Too bad.
 
@PeeHaa I currently favor that syntax over some of the alternatives because it allows for typehinting in a halfways reasonable manner. Other alternatives would often require specifying the type as string[] which is something that PHP does not and should not support.
 
8:26 PM
and if he's using mysql_real_escape_string currently, which one do you think pertains more? the first one, or the 2nd one... The first one would logically....
 
@minitech This are some thoughts for PHP 5.5, which will also allow typehinting non-classes (probably)
 
Im very lost i just read that first article a few times and I'm super confused. Ugh
 
@minitech func_get_args does not specify an interface
 
{just bitching not expecting anyone to save me}
 
@NikiC I am agree with that
 
8:29 PM
user it's a bit overwhelming to switch from PDO and mysqli when you're used to mysql
the easiest, would be mysqli as it's pretty close to mysql already without being completely different like PDO...
 
@PeeHaa The only thing that would get funny is passing vars by reference: sscanf(string $str, string $format, &... $args)
though that looks okay too I think
 
Yup looks fine to me
 
So, I will try to ramble through this. :) If I start by grabbing all the variables I need and then escapsulate them in mysql_real_escape_string($_POST["user-input"]); what will the problem be?
 
@user187680 not all your inputs go into the database
so you will likely overescape things
 
and thats a waste of energy/proceessing?
 
8:35 PM
No
You will have unnecessary characters around
Like \"foo\"
the \ are escape characters there, but unnecessary in that context
 
@user187680 You risk something like $_POST['lastname'] = 'O\'Toole';
Then you try to fix it with strip_slashes() everywhere
 
@MikeB Your comment will likely end up clarifying this for me veyr well. How could I end up with the stuff outside the ['userinput']
 
@user187680 outside ['userinput'] ?
 
@PeeHaa Another thing I wonder about is whether one should support varargs in the middle, like func($foo, ...$bar, $baz)
 
@MikeB well, you said the risk is that i will end up with $_Post['lastname'] = 'O/Toole';

how could crab get outside of the enclosed $_POST['lastname']
 
8:42 PM
@NikiC That won't be needed imo. Or maybe I fail to see a specific use case here
 
@PeeHaa I also think that it unnecessary
Just not sure, because Ruby for example supports it
Another thing that I think is unnecessary is default values for varargs. So func($foo, ...$bar = array('foo')) seems rather pointless to me
 
@NikiC Not only pointless, but looks rather strange to me
 
@PeeHaa yeah
 
hi
 
i give up
taking a nap
Okay last time According to this article stackoverflow.com/questions/129677/…
I can use mysql_real_escape_string
why is that wrong
 
8:50 PM
2 days ago, by tereško
Please, don't use mysql_* functions to write new code. They are no longer maintained and the community has begun deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide which, this article will help you. If you pick PDO, here is good tutorial.
 
@NikiC I can't see a use for that...
 
@draconis hello
 
okay okay
 
varargs at the end; and name them identically. I do func($foo, $bar, $arg, $arg = null) and capture via array_slice(), offset respectively.
 
ugh
don't star a link to a stared post
just star the original post
Also: Public Service Announcement time!
Stars are not bookmarks!
^ see this too often in the JS room.
 
8:54 PM
I was making a dummy blog to learn codeigniter, my problem is about css and js files. I made a master template and loads other views(it contains main stylesheets and javascripts) my question is here: there are some optional css and javascript files not required for every page(e.g slider css) so i don't want to load them in master templates header.
I've 2 ideas to solve this 1)Pass an array contains optional files to master template to tell what files will be included
 
@draconis Or just make it easy for yourself and do include it on all pages only minified, one filed and properly cached :)
 
@ircmaxell You're putting scalar type-hinting in PHP?
 
@rlemon That's slander, people can star me all they want :D
 
@GordonM working on it
 
@ircmaxell Work faster :)
 
8:56 PM
compressed + gzipped (if avail) + cache should be all you need
 
voila
 
I'm going to draft an RFC soon
 
What's the approach? Type hinting on PHP primitives, or objectification (String class, Int class etc)?
 
primitives
with casting on non-dataloss events.
so passing "12ab" to foo(int $a) would result in $a = 12 and a notice
 
@PeeHaa hmm, so i don't need to care about for slider.css(or any other css-js files used rarely) if they are included even they are not used. Because they are cached well?
 
8:58 PM
but passing "ab" to foo(int $a) would result in a E_RECOVERABLE_ERROR
 
@ircmaxell I like it :)
 
@draconis That's what I would do. Just dump everything in one css file and one js file, compress it and cache it. (Given it isn't going to be 10Mb large, but you have bigger problems if that's the case)
 
It would be nice to see both primitive hinting, and primitive casting (like your previous RFC) so one could do either func(int $i) or func((int) $i)
The latter resulting in no notices/errors, but a straight cast at call.
 
@PeeHaa Thanks. I Got it now.
 
@draconis Browsers can only (is this still the case?) download 2 files from the same domain at the same time and it will be cached so when properly setup it will only be downloaded ince
 
9:00 PM
@Bracketworks will never happen
 
I know :( I was an inactive proponent of your previous RFC
Either way, best of luck!
 
It was nice to meet you guys and thx for your advices @PeeHaa @NikiC @webarto Its time to say good night and cya :-)
 
later @ycelik
 
@PeeHaa Thanks.
 
np
 
9:11 PM
I seem to remember a quote along the lines of "The best code is the code you don't write". Does anyone happen to remember the full quote or who made it?
@ircmaxell Interesting approach
 
pokit.org/get/img/04d80e179febf5a8d64035a775ecc3bb.png if I enter value inside find(), it returns what is expected, otherwise it returns false, $id is a string with the same value... can't figure it out...
 
It would be nice to be able to configure the amount of fail that happens on a cast that causes lossage though. E_WARNING is a good default, but I'm sure some people would want fatal errors on cast fails.
 
yesterday, by PeeHaa
It should be a fatal imho
I'm that kind of a bitch ;)
Anybody has a problem with it when I change for($i = 0; $i < sizeof($people); ++$i) to for($i = 0; $i < count($people); ++$i) in an example on php.net?
 
@PeeHaa I'd say take it even further and declare count($people) outside of the loop
 
@CharlesSprayberry Yup that would be the way. Anybody has a problem with that?
 
9:22 PM
@PeeHaa please do
I can't stand sizeof
 
1
Q: How to validate captchacode with form

Lokeshi have a simple form <form id="main-form" onsubmit="return checker()"> <input..>//some input tags </form> function checker(){ $("#captchadiv").css("display","block"); } and captchadiv is <form method="post" action="test1.php"> <?php require_once(...

 
@ircmaxell me2
 
can anyone help me here?
 
@CharlesSprayberry Ow wait. No need to put it outside the loop:
> The problem lies in the second for expression. This code can be slow because it has to calculate the size of the array on each iteration. Since the size never change, it can be optimized easily using an intermediate variable to store the size and use in the loop instead of sizeof.
With the correct code (example) following it. Just need to get rid of sizeof()
 
@PeeHaa Fair enough
 
9:26 PM
github.com/webarto/instagraph/issues/4 can someone translate it to me, pls.
 
Actually, what if we implemented a true sizeof(). strlen($int), sizeof long, sizeof double, count(array), not sure for objects
 
@ircmaxell ehm, what would that be good for?
 
nothing
:-P
 
@webarto most i get is, the code isn't working for him...selinux is blocking it due to permissions. sounds more like a configuration issue than a programming issue, considering any way you try to use whatever files you're using is going to get similarly blocked
 
Evening everyone
 
9:31 PM
@Mittchel evening
 
Hm for some reason my form isn't submitting: http://www.deserved.nl/test/index.php/backend

When the login button is clicked, the post array is empty.. what am I doing wrong :O
 
OK, quick question. Say I have a collection of elements in the root node of an XML document that I've loaded with DOMDocument. Is it possible to select a single child of the root node at random with xpath?
Or would it be easier just to build an array of the child nodes of the root and just select a randomised index from that?
 
@cHao thanks, what I don't get is how functions like copy() and rename() are disabled and exec() is not.
 
Feel free to review my patch (anonymous #17906) :)
 
it's probably not the functions...it's more likely the files they're trying to access. selinux will sometimes block stuff even if fs permissions say it's accessible, cause it doesn't care about the fs permissions. it checks for the selinux attributes and uses those...and those probably say "apache doesn't get to mess with files outside these directories".
 
:P
 
@tereško DV for the question and the answer both.
 
pokit.org/get/img/3a404ab29ea051d8f450127a14e4e01c.png somehow \n slipped into session ID #fml
 
@cHao thank you, that makes sense, although that his problem, not mine then :)
 
9:55 PM
@webarto right :)
 
@NikiC @tereško @rdlowrey I'm about to push some change to the prototype. Before and after shots.
 
Guys, is there anyway i can override a flash banner link location?
 
although, i'd make sure i'm not trying to open files with more access than i need (like, say, opening an input file with read/write permission)
 
Nice to see how the debt goes up a few billions every day ^^
 
9:57 PM
Basically, things were aligned to a typographic grid. The content of the pages has not yet been altered (sorry, @tereško, the 2x2 grid still focuses on all the wrong stuff). The documentation pages benefit from the updates much more than the homepage.
 
@LeviMorrison , you need to do something with that button
 
@tereško I'm more worried about the content that button points to than how it looks.
But I know what you mean.
 
@NikiC sometimes up, sometimes down. but yeah. a couple billion dollars is less than a tenth of a percent
 
It puts things into perspective a bit
 
@LeviMorrison , but anyway , improvement is visible , IMHO
 
10:02 PM
@LeviMorrison Looks good
Apart from that button
Also I don't like that the content was moved down (significantly)
 
@NikiC Well, the homepage content will change a lot soon.
 
@LeviMorrison good
 
The 2x2 grid focuses on all the wrong things.
 
@NikiC , thats what happens when you add line-height
 
10:28 PM
> In order to write future-proof code, it is recommended that you prefix (or suffix) anything that goes into the global namespace with an uncommon 3-4 letter prefix (or suffix) separated with an underscore.
Now that's a naming convention :P
 
asdf_ done.
 
:P
 
@PeeHaa where's that from?
 
@NikiC What do you think?
 
@PeeHaa I have a suspicion ^^
 
10:39 PM
:) damn closed the tab. 1 sec lemme grab it
 
gordiansolution.co.uk Figured it was about time I actually put something on my home page. Even if it's just a logo.
 
That entire page might as well be delete in total imho
@GordonM Registered on: 02-Oct-2011
You're fast :)
 
Official PHP Coding Standards. I wish I could hyperlink directly to the naming conventions.
 
And that's annoying. The host provides a data and a lib directory that's outside the web root, but if you put PHP classes there you just get permission denied when a script tries to include them :(
@PeeHaa Like I said, about time I did something with it. So only 8 or so months to make a logo and a random quote displayer.
But it's HTML5 compliant!
 
:D
 
10:44 PM
And I probably need a pro to look at the logo too. I'm no graphic designer.
 
> NEVER USE strncat(). If you're absolutely sure you know what you're doing,
check its man page again, and only then, consider using it, and even then,
try avoiding it.
@GordonM Me neither. Far from :)
 
@PeeHaa That's the point where you're meant to say "But I think it's really good!" :)
 
@PeeHaa I'd change that < 11 to <= 10
 
@GordonM It looks like ****.
 
@NikiC Good point
 
10:49 PM
@LeviMorrison Thanks!
 
@GordonM You are welcome to ask for my advice whenever you'd like it.
 
Thanks, will keep that in mind. In the meantime, bed beckons.
 
http://pokit.org/get/img/5fb5f226307aff2da859d1d148586532.png
my work here is done, goodnight folks.
 
I'm also off. later
 
11:09 PM
Word
 
me too
night
 
11:27 PM
anyone happen to know off the top of their head: if git update-index --assume-unchanged <file> is a local setting only or one that gets set in the head?
 
no idea
crap, I forgot to turn off the firewall for SSH port on the new mac mini. Meaning that I can't connect to it because I don't have a HDMI cable or DVI - VGA adapter handy
dangit
that's a day lost
 
Me neither... I've got a file that is being tracked that shouldnt.. tried the git rm --cached <file>, and it works kinda... pull from repo on another machine and the file is completely removed from every branch in the repo on the 2nd machine... odd!
 
11:57 PM
Where do all of those user* accounts come from?
 
00:00 - 18:0018:00 - 00:00

« first day (625 days earlier)      last day (4326 days later) »