« first day (600 days earlier)      last day (4366 days later) » 

6:10 PM
so, i get that a header redirect needs to come first, but how do i accomplish this if the form getting submitted is included as part of a template page?
 
@MikeS I don't follow
 
Processing a form and displaying it are two different things. Unless you're using Zend Framework :)
 
From php.net: Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.
 
@GordonM Are you seriously surprised about this. Loads of sites can be 'hacked'.
 
@GordonM using it right now... Kohana I miss you
 
6:18 PM
Not surprised. Just depressed. That web developers once again keep making the same mistakes over and over.
 
@MikeS if the header call is to clear the POST data, usually the flow is this: For is submitted, and a POST 'hook' at the top of the script (before output) processes it. If successful, you can redirect to a success page, or back to the same page. If you want to display a success message you can redirect with a GET variable
 
Hi guys, facing this wired problem today... symfony2 , apache server.. /app_dev.php works app_dev.php/ throws 404 ... just tried with vanilla sf2 .. what might be the reason ?
 
@GordonM I've got a huge list myself with vulnerable websites both small and big. The really sad thing it is most site owner don't even care
Anyone ever created an addon for FF?
 
@Krish why would anyone try to access app_dev.php as a directory?
unless it's a master file, which would be different
 
6:23 PM
 
that doesn't exactly add clarity to the situation
 
when I add / to localhost/app_dev.php/ its throwing 404
 
@Krish I can't open link, it says 404
 
@rdlowrey, @hakre and others: I'm going to do some work on the cv-pls plugin. Any requests / suggestion while I'm at it?
 
@webarto : It's my environment :P
any way.. what might be the reason.. the scenario is, if I add / to any of my url , its not working
 
6:25 PM
@Krish did you configure your routing properly?
 
@orourkek yes, i found the PRG wiki entry a few minutes ago. here's my simple form. pastie.org/4045767. how should i fix this to prevent the resubmit. your help is appreciated.
 
I thought the same, then I tested with default sf2 untouched package .. same problem
 
@Krish took me ten seconds of googling to find the answer
 
what does untouched package means? you shouldn't change core files
 
@webarto : I meant vanilla, without loading my bundle . etc..
 
6:30 PM
@MikeS one sec
 
no rush. just trying to figure it out before it becomes a problem. thx
 
@orourkek : thanks for googling it out for me ..
 
I hate it when I'm searching for a solution for a problem I have and find an answer on SO on the topic saying:
> As revealed in the comments for the question the problem originates from a lack of understanding on developing and testing Chrome extensions.
 
what to cache in highly dynamic application, question is now
 
@MikeS this is my flow (pseudocode at the bottom)
(ignore the framework specific stuff, the logic is framework agnostic, obviously)
 
6:42 PM
@orourkek thanks. let me work with that.
 
And so begins the linkedin spam. :(
"It would be great to connect with you and to see if what opportunties we have for you in the future, "
 
@GordonM email?
 
@GordonM yea, great for who? is the question
 
Yeah, email
If what opportunities.
 
i like those that say, 'we've reviewed your profile and think you'd be a great fit for our <insert technology not listed on my profile> position.
 
6:45 PM
Used to get those before the hack. All the time.
 
@GordonM Did they finally confirm confess they were hacked?
 
Well there was that blog post about "enhancing your security" by adding salts
 
@GordonM So: no.
 
@MikeS Or the recruiters that call based on a resume dated 2009 :P
 
Ben
http://thehackernews.com/2012/06/linkedin-confirms-millions-of-account.html
My jaw dropped when I saw the part where they said, "we enhanced the security of our site by adding a salt to password hashes".
Since when something as important as salting became an enhancement rather than a built-in measure from the get go...
 
6:52 PM
I don't know about over there but in the UK the recruiters hoard CVs from sites like monster or linkedin, and will keep pestering you over them years after you've deleted them from the site.
 
Im running into cache issues with client browsers.. if we push a major DOM change users are seeing things as messed up.. how can i define in my css/js that the browser needs to re-load the cache.
 
Hey
 
@rdlowrey What're you up to?
 
@Mike You could add a query string
 
i lol'd at that @Ben couldn't believe it
and what about changse to the actual DOM @RepWhoringPeeHaa e.g; adding a new element
using CI 2.1 framework fyi
just set some new headers?
 
Ben
6:59 PM
as users we take security for granted, just because a company is big doesn't mean that they're doing everything in their power to protect your information... sad but true
3
 
absolutely correct
scary really.
 
hmmm dunno
> Error in event handler for 'undefined': desktopNotification is not defined ReferenceError: desktopNotification is not defined :(
 
Ugh, I really don't like umlet. LucidChart is much nicer.
 
@Ben I don't really take security for granted, because I know people screw up
 
Ben
@RepWhoringPeeHaa that's smart, I'm learning to be more careful as I read more about these massive failures
 
7:19 PM
// array oriented programming at its best.
        $trs = array(
            array(
                'data'=>array(
                    'id'=>'fullname',
                    'label'=>'Fullname',
                    'value'=>$this->properties['fullname']
                ),
                'tpl'=>array($this,'tplInputUntyped')
            ),
            array(
                'data'=>array(
                    'id'=>'netid',
                    'label'=>'Net ID',
                    'value'=>$this->properties['netid']
 
@LeviMorrison Where'd that come from?
 
@GordonM My source code at work, lol
I'm not going to refactor right now, so I thought I'd comment it.
I was like, hmm, what to write? Oh!
 
never install packages from unstable
 
@webarto I assume you are using Debian? :)
 
yeah, I fscked up everything while trying to install mysql-*, magically switch to unstable and messed up whole system :)
 
7:27 PM
@webarto unless you want unstable packages
 
yes, actually I wanted to update MySQL to 5.5 (was 5.1), and then I got both of them installed at the same time... so now I'm struggling to remove everything and install just one... but all I got is E:
 
Which is better performance-wise? PDO::bindParam or PDO::bindValue?
 
@webarto By the way, I never recovered last time I tried using unstable. I reinstalled my system .
@Truth Don't know, don't care.
 
@LeviMorrison sometimes I think that XP is more stable than Linux (Deb) :)
 
@webarto Meh, I haven't had many issues besides when I use unstable, which, they do warn you about . . .
 
7:36 PM
somehow, it magically switched me to unstable... by the time I've figured it out it was too late heh
 
@webarto Lies. I had to pull teeth to get it to use unstable for the first time.
 
Again, wants to remove half of system, somehow packages from unstable left in stable, dunno, will throw out of window :P
 
@webarto Reinstall time.
 
ah, mysql-common was 5.1, while everything else was 5.5 (fingers crossed)... still half of system is fscked :D
(reinstall time)
 
@Gordon How could a make a request to the backlog again?
 
7:58 PM
PHP 5.4.5-dev (cli) (built: Jun 1 2012 16:22:07), 5.5 coming soon?
facebook.com/note.php?note_id=434698460932 can someone decypher this data, it's comparison (speed) 5.1 vs 5.5, but I can't figure it out...
 
8:14 PM
I've got an encoding issue. Basically, there is the user $input which I format a bit and output back as HTML. The user should not be able to write HTML at all.
 
@webarto 5.5 is scheduled for early next year some time.
 
the code looks like:

$input = $_GET['input'];
$input = htmlspecialchars($input);
$input = nl2br($input);
$input = linkify($input);
$input = codify($input);
echo $input;
 
@salathe forgot that (sub) version can be 10+ :)
 
Now, that's the very basic thing, but I just want to give the idea.
My problem lies with htmlspecialchars() and linkify/codify
 
@webarto Yeah, we've had up to .17 :)
 
user557846
8:17 PM
strip_tags() ?
 
Basically, linkfy detects urls in the input and replaces it with a link tag, and codify does something similar with code.
@Dagon That ain't safe.
The problem lies in the fact that linkify fails to run because URL entities has already been encoded as html entities.
 
user557846
then linkify, before htmlspecialchars
 
And of course, I can't reverse the order of the functions because htmlspecialchars would convert links to html (<a to &lt;a)...
 
@Christian what about first parsing it and create some kind of tokens of the urls and later translating them back?
 
@RepWhoringPeeHaa Ah, we came to the same conclusion. Seems it has to be complicated after all :(
 
8:20 PM
@Christian shouldn't be too complicated imho. You already can recognize urls (linkify) so you only need to temporary swap them
 
user557846
if linkify can properly identify urls, it could probably run htmlspecialchars() on all else, but not knowing the function its just a guess.
 
@Dagon it's a bunch of regex's. Hey, I hate regexs, ok? :P
 
user557846
its ok by me, not my problem :-)
 
Better back up before another power outage hits.
And to think I used to give money to missionaries in Indonesia.... -_-
A good two thirds of Malta is still running over turbines donated by the Italian government (which it received from the US, and which it refused to install in Sicily because they were already old) :/
That's like 40 years ago.
 
haha
 
Sam
8:45 PM
Evening guys, bit of a problem if someone doesnt mind helping
I have to get a number of different values from a log file, and i wanted to create a number of array keys, so i could do $example[$newKey]
How would i do this?
 
user557846
kind of vauge
 
w00
@Sam Show us how to log looks like, this isn't a very descriptive question
 
Sam
Perhaps this will help - > pastebin.com/vULYQNqK
Im just writing a better explanation now, give me a min
 
Good evening
 
good evening
 
user557846
8:49 PM
morning! no really :-)
 
Sam
I would like to create empty keys in an array. This is because i will be filling these keys with an array further down in my code

So say i have a string "example", how do i make a empty key in an array names with that string
Evening
 
0
Q: What is wrong with this MySQL Query (PHP)?

Jim PSo I have this small section of code that for some reason doesn't want to actually work. I have been trying to figure out why, and to no avail. $mysqli =& db::connect(); $sql = "SELECT * FROM `my_table`"; $result = $mysqli->query($sql); if( ! $result ) die( "SQL Error ($mysqli->errno)...

 
user557846
you cant have an empty key, only empty values
 
How can something both be an object and not be an object?
 
$names = array("example" => null);
But it seems rather pointless to me...
 
Sam
8:51 PM
@eggyal I shall try that, cheers
You think i may be taking a wrong approach? I know its hard to tell with little information
 
Why not add example to $names when you actually have some content for it?
 
Sam
Im looping through a log file, searching for all dates, i add these as keys. Then when i loop through the code looking for a particular string i would add this to the key i created earlier
 
@Ben you guys are acting like mysql got hacked or something.. ;]
 
Then perhaps you want to initialise $names['example'] to itself be an array (although you could probably improve on this data structure with something more OOP-esque):
$names['example'] = array();
 
Sam
Ok, thanks for the tips, ill give it a go :)
 
8:57 PM
@lonesomeday Is it possible that error is being thrown from another line containing a different call to fetch_assoc()?
 
Ben
Security is Security, doesn't matter who got hacked. Bottom line is once your information is out there there's not much you can do to recover...
see: http://www.theatlantic.com/magazine/archive/2011/11/hacked/8673/?single_page=true
 
bogus info == win
call me charlene ;]
 
mysql_*
 
Ben
9:12 PM
@CarrieKendall how many sets of bogus info do you keep track of? I don't know the number of online accounts I have anymore, help me out here how do you do it?
 
idk, i keep it simple.. but i dont really have any interest for social networking.. i have the basics and that's because at some point i got tired of people asking. but for the most part i just use a bogus email when applicable
 
Ben
9:27 PM
that's smart... I over think my online presence at times
with that said it's time to pack up, nice chatting with you
 
Sam
9:38 PM
Bleugh, regular expressions
Say i have this string to search through

"77.68.60.219 GET /modules/user/user.css e 80 - 190.147.92.10"

What regular expression could i use to get

"/modules/user/user.css"
 
@Sam I gave you NEARLY exactly what you needed . . .
 
Sam
@LeviMorrison?
 
6 hours ago, by Levi Morrison
#!/bin/bash

awk '$9!="404" && $9!="500" {print $7}' "$1" \
| grep -ivE '(.gif|.jpg|.png|.js|.css|.swf)' \
| sed 's/\?.*//g' \
| sed 's/(.+)\/$/$1/g' \
| sort \
| uniq -c \
| sort -rn
 
Sam
I have decided to use php
 
@Sam Your loss.
 
Sam
9:46 PM
@LeviMorrison Im going with what i know, otherwise i will never get it done
 
@Sam I'm going to DO it for you. Give me a moment.
That's all it will take.
awk  '{print $3}' "$1" \
| sed 's/\?.*//g' \
| sed 's/(.+)\/$/$1/g' \
| sort \
| uniq -c \
| sort -rn
I'm pretty darned sure that will work.
@Sam Feel free to ask me wtf it's doing.
Oh, stick that in a file, then call it like:
 
Sam
Its not as simple as that though, i need to have multiple counters to count different files, sorted by day, which will be easier to do by PHP
 
@Sam You doubt the power of awk, sed, grep?
@Sam You doubt the power of awk, sed, grep?
 
Sam
No, but i dont know anything about it! I cant ask you to do my work for me...
 
lol
I suppose you can't.
 
9:51 PM
@Sam Something nice for a change
 
Sam
Whats that @NikiC?
 
@Sam Someone not here for give-me-tha-codez :)
 
Sam
Aha :P
I only ask for bits i get snagged on, 95% i should be able to find by google if i struggle :)
 
@CarrieKendall you still online?
 
Sam
@NikiC Do you have any idea about the regular expression i may need? I asked a few minutes ago
 
9:53 PM
@NikiC So i have this project, and I want to be able to store users' information in the database, and display it like facebook does. Can you help me with the code??
Wait, that English wasn't bad enough...
 
@Sam Well, wouldn't an easy way be to just explode(' ', $line) and take [2]?
 
Sam
LEGEND
Why didnt i think of that
Cheers
 
^^
 
Is anybody on chrome here who is willing to test something for me?
 
Sam
9:57 PM
Sure
 
@RepWhoringPeeHaa yep
 
@orourkek That's incredible
 
@RepWhoringPeeHaa sec
 
@orourkek sure
 
Sam
9:59 PM
@RepWhoringPeeHaa What would you like me to try with it?
 
@Sam Have you installed it?
 
Sam
I have
 
Sam
@RepWhoringPeeHaa It has disappeared from my plugins section though
 
@Sam was ^that converted to a onebox?
@Sam :(
 
10:01 PM
@RepWhoringPeeHaa did you add the slider in this patch?
 
any errors?
 
Sam
Ill restart my browser
brb
 
well, chrome took FOREVER to start back up, but that might be unrelated
 
@orourkek slider was in 0.16 i think
@orourkek Wasn't me (I hope) :)
 
10:01 PM
idk what version I had before, but I don't remember the slider (at least not where it starts minimized)
 
Sam
Aha @RepWhoringPeeHaa I have a "onebox" now
 
Could you go to plugin settings and enable the backlog?
And refresh php chat
 
@RepWhoringPeeHaa ah, you did change the start height, that's what's different :)
 
@orourkek screen real estate FTW! :)
 
That was the most only annoying part of it
 
10:03 PM
@orourkek p.s. you can double click the slider to fully expand / collapse
Does the backlog work?
 
Sam
@RepWhoringPeeHaa I have the backlog now where the description for the room used to be
 
@Sam nice
woohooooo seems bug free
 
Sam
@RepWhoringPeeHaa Ill let you know of any errors :D
 
@Sam great
 
@RepWhoringPeeHaa no errors here
 
10:05 PM
Yay! Finally can commit a new version
 
still waiting for the FireFox addon
 
tnx for testing guys
@NikiC I know. I've set it before I'm going to do it this weekend :)
 
Sam
Can you make this plugin work on IE6? Cheers
 
@NikiC But serious. I need some basic working example to see how the FF addon stuff works
Just see it this way. Once I will deliver it will be bugfree and full of features ;)
 
Well, building an FF addon should be simple with JetPack / Addon SDK, shouldn't it?
 
10:10 PM
@NikiC Downloaded. Well check it out asap
wtf how can my dev branch be 64commits behind. oh my. I've screwed up my repo again...
 
ughhhhhh
@RepWhoringPeeHaa somehow the browser restart made chrome start disabling the [external] stylesheet for the site I was working on...
 
@orourkek :o
 
And google is changing my terms in quotes!
what is this trickery
I don't want synonyms, google, that's why I put it in quotes you fool!
 
People that use position: fixed on their site should be shot - not conducive for portrait monitors at all
 
10:19 PM
hey does anyone know how to add a new panel in the "settings" tab in wordpress via php?
I want to add a new set of options for a theme
 
@Alex Sorry, I stop reading whenever I see "Wordpress"
 
yeah me too it's my first theme after 12 years of php
i hate it..
;-)
 
Why you hate me git? :(
Auto-merging updates.xml
CONFLICT (content): Merge conflict in updates.xml
Auto-merging cv-pls/script.js
CONFLICT (content): Merge conflict in cv-pls/script.js
Auto-merging cv-pls/options.html
CONFLICT (content): Merge conflict in cv-pls/options.html
Auto-merging cv-pls/manifest.json
CONFLICT (content): Merge conflict in cv-pls/manifest.json
Auto-merging cv-pls/js/options.js
CONFLICT (add/add): Merge conflict in cv-pls/js/options.js
Auto-merging cv-pls/js/PluginSettings.js
CONFLICT (add/add): Merge conflict in cv-pls/js/PluginSettings.js
 
@RepWhoringPeeHaa Git is in cahoots with google to make our lives miserable, one failed action at a time :]
 
10:24 PM
@orourkek Both start with G, so they are clearly related :)
 
@NikiC the conspiracy starts to unravel!
 
How to fix those conflicts?
 
@RepWhoringPeeHaa --force
 
go into the files, fix em
@orourkek Brute force hasn't yet helped anyone!
(I'm lying.)
 
@NikiC just as helpful as the docs: "All you need to do is edit the files to resolve the conflicts, and then". How do I know what to fix? :P
 
10:27 PM
You mean I'm not supposed to use !important on all of my css rules?
 
@RepWhoringPeeHaa Open the file you'll see ;)
It'll be full of <<<<<<<<<<<<< and >>>>>>>>>>>>>>>
 
@RepWhoringPeeHaa Yeah, git automatically marks up the areas of conflict in your local copy
 
@orourkek No, use it. They all are important after all!
 
True, I wouldn't want to play favorites with my CSS rules...
 
@NikiC hahahaha I was typing that shit in shell by following the docs :P I'm an idiot. But you guys should know that by now :)
BTW what is the reason it couldn't auto merge those files. E.g. in one file I just change 1 number. Would it be soo hard to merge the hell out of it?
 
10:31 PM
When a visitor requests http://my-domain.com/blogs/, I would like that request to be proceeded to the file blogs.php which is in my wwwroot directory. Also, if the visitor leaves out the trailing slash (http://my-domain.com/blogs), I would like the trailing slash to be added automatically. I got it to work with these two lines:
 
@RepWhoringPeeHaa Better safe than sorry ;)
 
RewriteRule ^blogs$ ./blogs/
RewriteRule ^blogs/$ ./blogs.php
Is this a good way to do it?
It works but I'm not sure if it's reliable and how well it performs...
 
@ŠimeVidas I think you meant RewriteRule ^blogs$ ./blogs/ [R=301]
?
 
@LeviMorrison Could you explain that thing at the end?
Ah I see :)
Redirect 301
 
10:34 PM
too late ^^
 
@NikiC Redirect is better than rewrite?
 
@ŠimeVidas Just a different meaning.
 
@ŠimeVidas Nevermind ;)
 
Wait, what now... ?
Should I add that [R=301] thing? Does it perform better?
 
RewriteRule ^blogs$ ./blogs/ [R=301] # the url in the browser will change from `/blogs` to `/blogs/`
RewriteRule ^blogs/$ ./blogs.php # `/blogs` will silently go to `/blogs.php`
 
10:35 PM
@ŠimeVidas No, it performs worse, but it is what you need.
 
@NikiC But I got it working without that [R=301] thing...
 
Otherwise the URL won't change in the browser, only on the server ;)
 
The URL in the browser changes correctly (the trailing slash is added) (in the address bar)
 
@ŠimeVidas huh? Without a redirect?
 
With the code I posted above...
 
10:37 PM
that is odd ;)
 
@NikiC Yeah, what did you think a rewrite does? it rewrites the URI
 
@orourkek But not visibly to the user unless you specify [R=301]
 
@orourkek Well, it also gives the instruction which PHP file should take the request without rewriting the URL...
(see the 2. line in my code above)
I guess, I'll have to put a demo up... give me a sec...
 
@LeviMorrison A rewrite rule without a redirect will show the same uri to the user that they typed in, but send the request to the rewritten uri
 
@orourkek You just said what I did.
 
10:40 PM
@LeviMorrison You're right, I read it slightly wrong. But there are two ways to look at it. Let me see if I can form these thoughts into a cohesive thought
 
OK, here's the demo:
The PHP-file: ecmazing.com/test.php
The test URL: ecmazing.com/test
The contents of .htaccess:
RewriteEngine On

RewriteRule ^test$ ./test/
RewriteRule ^test/$ ./test.php
 
@ŠimeVidas I'm curious, in a browser that hasn't gone to that page, try:
RewriteEngine On

RewriteRule ^test/$ ./test
RewriteRule ^test$ ./test.php
 
Why do you need two rules? it's a regex, you can match the trailing slash
^test(/?)$
 
@orourkek Because the top rule seems to be written in the users client.
By how it is defined in that snippet, it shouldn't be doing that.
 
RewriteRule ^test(/?)$ /test.php will cover both of those rules
unless you want to force the trailing slash to be removed
 
10:49 PM
@LeviMorrison It doesn't seem to work the other way around... I've added a test2.php file. The updated contents of .htaccess are:
RewriteEngine On

RewriteRule ^test$ ./test/
RewriteRule ^test/$ ./test.php

RewriteRule ^test2/$ ./test2
RewriteRule ^test2$ ./test2.php
 
@ŠimeVidas But WHAT doesn't work? What is it doing?
 
@LeviMorrison The slash persists...
(www.ecmazing.com/test2/)
 
Change to:
RewriteRule ^test2/$ ./test2 [R=301]
RewriteRule ^test2$ ./test2.php
 
@LeviMorrison now you're looking at a very measurable delay in page load times...
@ŠimeVidas Did I miss where you explained why the trailing slash being absent is important?
 
@orourkek Shush, you honestly aren't helping. I know what I'm doing, I'm trying to teach @ŠimeVidas
 
10:52 PM
@LeviMorrison Now it redirects to http://www.ecmazing.com/home/simevidas/ecmazing.com/test2
 
@ŠimeVidas Now do you understand why [R=301] is important?
 
Sorry, no :)
 
The behavior of test is being affected by some option I don't know of, possibly Multiviews.
The behavior of test2 is correct.
If you want it to redirect the user, add [R=301] to the end of the RewriteRule.
 
@LeviMorrison This isn't a situation for 301, it's a simple URI rewrite...
enforcing a trailing slash does not mean redirect
 
Just to repeat myself quickly, I would like the trailing slash to be added in case it's not present.
 
10:55 PM
@ŠimeVidas Exactly. Now @orourkek, will you be quiet? You aren't helping, lol.
 
@LeviMorrison You just gave him the exact opposite of what he was asking
 
@orourkek No, I taught him how to do it backwards on a different example.
You are the one backwards on Rewrite and Redirect.
 
But I didn't learn anything yet... :/
 
@ŠimeVidas That isn't my fault. Let me try regardless.
You want /users to redirect to /users/. What rule should you use?
 
Yes! Survived the great conflicts war
 
10:58 PM
@LeviMorrison RewriteRule ^users$ ./users/ would work...
 
@ŠimeVidas Wrong, that would rewrite it. You have to add [R=301] to the end of the rule to redirect it.
 
@LeviMorrison I've checked in the dev tools of my browser. Even without [R=301], a 301 redirect is performed.
 
@ŠimeVidas Why won't you listen?
 

« first day (600 days earlier)      last day (4366 days later) »