« first day (1019 days earlier)      last day (4155 days later) » 

07:21
good mornings
Hi Good morning Guys!
anybody here?
nope.
I am also not here.
Ohh ok ok, Do You know about Zend Guard? @Jack @YogeshSuthar
07:26
Hello everyone.
After upgrading our server to 5.4.17 PHP version, the websites prompt to download a file and do not open. anyone else face to this problem?
@DRAJI annoying, please don't consider it
What? @DaveChen
@DRAJI Why would you want that?
@DRAJI any form of protection on scripts (or otherwise uncompiled code) is silly
07:28
What could possibly be so secretive that it has to be done in php?
user1125394
sqlfiddle.com/#!2/d26ef/12 I did a classic mistake I think, but now it's ok
Protect code from unauthorized use @Jack
Why @DaveChen
And why would that happen? @DRAJI
@DRAJI aside from not being effective (determined users will still bypass it), you're hurting your user's trust in you and in running the code
07:31
Why do some people never end their <?php in some files
@Tredged they don't need to output html?
@Tredged Because they don't have to.
Is there a big difference then closing it or not?
@Tredged Depends on how newlines are handled in your editor.
If you're not sure, omit the ?>
you might want to omit, because if you have some extra characters at the end of ?> it will be outputed :P, this would be dangerous if you include a class that has random \r/\r\n/crlf
07:33
s/outputed/output/ :)
Ah ok
I have created magento Extension for slider, i want to protect my code from unauthorized use, Please guide me(which method is effective for me) !
Mornings
Morning
@JamshidHashimi hi man I just encountered the problem last night XD
solved by reverting the upgrading
@JamshidHashimi the problem however seems to be application server that can't load the php module
in my case I'm talking about apache
07:49
@gr4devel Oh really? Thats great to hear that reverting the upgrade works, because we asked the technical department to revert the upgrade
@JamshidHashimi yeah my last night experience confirm that
@gr4devel Great thank you. I am now waiting for the revert operation to complete
@JamshidHashimi my pleasure man :)...however let me specify that I tried this on my machine (btw Ubuntu) by utilizing the package manager
the package manager do many thing automatically and simplify a lot the configuration procedure :)
@gr4devel In our case it is a production server. The guys we are hosting our websites on their servers did this and now, we asked them to revert the upgrade. Clients are getting crazy, calling the technical support here :)
Thanks God I am in development side :)
If the browser is prompting you to download the file, one of two things is happening: 1) The response headers are instructing the browser to do so, or specifying a Content-Type that the browser is incapable of handling internally or 2) The data being returned is binary (essentially that means it contains certain bytes <0x20 or >0x7F) - either way, the browser has decided it is unable to render the response and you could do with working out why.
After all, rolling back isn't really a solution, it's just a band-aid
07:54
@JamshidHashimi I know your pain man ;)
@DaveRandom you're right man the solution will be try to fix the problem
but in this case the first thing to do is to bring the production site online again
as soon as possible
@JamshidHashimi do you have a link to a live page where the problem is occuring?
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
@gr4devel Indeed, I accept that, but just before applying the fix there are a couple of tests I'd like to do if poss
@DaveRandom for wordpress websites, It prompts to download a file I post above.
@DaveRandom www.netlinks.af
Right that's an Apache config problem
07:57
@DaveRandom ok I get it ;)
@DaveRandom yep in particular the php module isn't loaded by our friend apache :)
Well that's just the question, is it running as a module or under CGI/FCGI?
@DaveRandom This crazy clients wont let us work over the problem. For now, I hope that this revert upgrade work
Well that sucks, I'm reasonably certain that's a 2 minute fix
agree with @DaveRandom
If you are running as an Apache module you should reconfig as FCGI, it's way easier to deal with in general and certainly easier to fix issues like this
08:01
@DaveRandom Yeah, but specifying that two minute fix means some hours of pain..
Yeh I know that problem only too well.
08:13
Good morning
morning @dragon112
:)
08:27
not adding "\r\n" broke the attachment form, it did attached 2 files, bit everytime the first file is never attached, instead I get base64 dump, I wonder y is this happening
morning
Yo hamza
@HamZa morning
How are you guys ?
good afternoon all
08:31
Alive :D
Good everyone
@PLB Everytime I look at your miniature profile picture on the right, it looks like a hip bone
Or an x-ray of the generic hip area
PLB
PLB
@Jimbo lol Never noticed that.
@HamZa am fyn ya and so is @dragon112 ... howz you?
@Mr.Alien fine, but
E_NEED_SOME_SLEEP | E_NEED_SOME_REST
2
08:36
@Mr.Alien How would you know?! :o
@HamZa THAN_GO_TO_SLEEP_AND_HAVE_SOME_REST
@dragon112 I control street cams of netherland :p
PLB
PLB
@Mr.Alien Undefined constant...
@Mr.Alien heh, I'm on internship now ...
@PLB lol
@Mr.Alien Lies!
08:38
@HamZa E_NO_SLEEP_FOR_YOU
@dragon112 constant defined lol
ok my hand is bleeding.. brb
@Mr.Alien wut
@Mr.Alien E_HAND_MISSING
a lil cut on my hand, @PLB error_reporting(0);
PLB
PLB
How is getting rich achieved?
:D
@PLB STEALING either working hard+smart, I prefer second one
PLB
PLB
E_NO_STEALING_ALLOWED
off for lunch, so later..
@PLB WORK_HARD
08:54
@Mr.Alien later ...
@Mr.Alien Notice: Use of undefined constant
marc b go get a pizza — user1205600 13 hours ago
lol
user895378
@Jimbo I read your code and everything looks good. Thank you for not turning it into a service locator.
Hi
echo '<script type="text/javascript">'
,'document.cookie = test + "=" + test + 1000 + "; path=/";'
, '</script>';
i tried echo the js inside php like this,but i got ReferenceError: test is not defined error. kindly adivce what i missed here
mornign
09:02
@rdlowrey Hey, cool thanks :) I stay well away from that ;) The only problem is that you can't target the __construct() of the controller using this method (so no class based dependencies for the controller)...
@Dinesh You aren't defining the variable "test"
@Ocramius morning
@Ocramius hey
user895378
@Jimbo Why not? You can easily setup a simple configuration array for any constructor dependencies that can't be instantiated automatically.
user895378
And if your routes pull arguments from the request URI you can pass them to the controller method when invoking execute()
09:04
@HamZa i am passing dynamic value here document.cookie = name + "=" + value + expires + "; path=/";
@rdlowrey Before calling the 'execute' method, $controller = $this->resolver->getController($request); actually creates the controller object (parses it too)
@Dinesh I hope by dynamic you don't mean you're mixing JS with PHP variables ?
That is what fires the __construct(). I tried making Auryn create the object, but then I'm not parsing for the controller / action correctly
@HamZa like this 'document.cookie = '.$response['0'].' + "=" + '.$response['1'].' + '.$response['2'].' + "; path='.$response['3'].'";'
i have situation to use js inside php so i refer this stackoverflow.com/questions/1045845/…
@Dinesh can you give the full code in a pastebin.com ?
user895378
09:09
@Jimbo Oh ... then I guess you've fallen victim to the substandard routing code :) The routing should resolve the URI to a class/method name or predefined callable and a set of arguments from the URI. It shouldn't mix endpoint resolution with the concern of instantiating classes.
i need to set cookie based on db values like this
if($response && count($response) > 0 && is_array($response))
{
// var_dump($response); exit;
echo '<script type="text/javascript">'
,'document.cookie = '.$response['0'].' + "=" + '.$response['1'].' + '.$response['2'].' + "; path='.$response['3'].'";'
, '</script>';

}
@rdlowrey Exactly. This is Symfony2 as well! I'm going to have to write my own router just to use Auryn!! :/
user895378
@Jimbo just to use auryn because the sf2 router violates SRP making it not play nicely with other code
@Dinesh why don't you use PHP setcookie() ?
@HamZa call_user_func_array('setcookie', $response); this works fine. but we are using varnish cache system. it rejects cookie if we use php..so i tried with javascript
09:12
@rdlowrey Yes. Although writing my own, last time it looked like this. You can see why I'm hesitant.
user895378
@Jimbo I've been meaning to write some simple routing code to use with Auryn for a while. Not sure if you're on a strict time table but I might be able to get around to it in the next few days.
@rdlowrey No timetable, just excited to write and utilise / learn from good code :) All this must work before I start using websocket services
@Dinesh Try to use something like this
echo '<script type="text/javascript">
document.cookie = "'.$response['0'].'"="'.$response['1'].$response['2'].'";path="'.$response['3'].'";
</script>';
Remember, you want a string in JS and not a variable
@HamZa okay let me try and check
@HamZa ReferenceError: invalid assignment left-hand side getting this
@Dinesh Sigh ...
echo '
document.cookie = "'.$response['0'].'='.$response['1'].$response['2'].'";path="'.$response['3'].'";
';
09:18
What is $response btw?
And why is PHP generating JavaScript code that sets a cookie?
@dragon112 again error_reporting(0);
@HamZa this wokrs but cookie value is coming with expires
@Dinesh setcookie() - use it.
@Jack call_user_func_array('setcookie', $response); this works fine. but we are using varnish cache system. it rejects cookie if we use php..so i tried with javascript
09:21
@Dinesh Well this is some basic string concatenation
=O ... then fix Varnish
@HamZa thanks a lot...i will check
@Mr.Alien Unknown function: error_reporting()
@dragon112 SLap
I've used up all my close-votes, now where's my badge? xD
09:27
@Mr.Alien <3
0
Q: Joins on tables are not working YII?

Amit SinglaI want to get the data from two tables.I have used the below code to do so. I am new to YII, if i am using the wrong way,please suggest me the right way. Here is the code of controller: $dataProvider=new CActiveDataProvider('Users', array( 'criteria'=>array( 'with'=>...

please help me
@dragon112 <3_<3
@Mr.Alien 8>.<8
09:30
@dragon112 wad u doin deze days?
Making a C# library
Seriously or kidding>?
Yea, now people need logical operators in CSS
0
Q: how to combine the logical operator NOT together with the orientation media feature

Luca BorrioneI need to target css properties to any device which is NOT iPad and based on the device orientation. Nested media queries don't work on my simulator. Example @media not screen and (device-width: 768px) and (device-height: 1024px) { @media screen and (orientation: portrait) { DIV { ...

@Mr.Alien Seriously
@dragon112 aa great ;)
JTG
JTG
09:41
hi all
have a query regarding php cookies
^ why does that have 3 upvotes?
JTG
JTG
0
Q: Unable to access cookie after page redirect

JTGI am setting a cookie containing a vlue in this format and redirecting to another page via the PHP header function. Here's the code, setcookie("myCookie", $cookieValue, time() + $cookieLife, "/"); // cookieLife is expiration time in sec header("Location: $baseURL/index.php"); // $baseURL is "htt...

help anyone?
ahan ahan
WOAH
@bobthecow @jmikola @ircmaxell actually, even worse. <?php spl_autoload_register('var_dump'); $foo = '../../foo'; new $foo();
09:45
@dragon112 Actually.. if it hasn't been answered elsewhere, could be genuinely a useful one?
@Jimbo For me it's like you're asking, I've got json_encode and tried decoding it with array_flip. How to decode it properly ?
@Jimbo probably because it's a really good example of RTFM :p
3 upvotes now...
09:49
It's right there: php.net/manual/en/…
0
A: php switch menu undefined variable

Yogesh SutharI didn't understand your lang but the problrem is you are not using $_GET['menu'] to retrieve the GET parameter. $menu = $_GET['menu']; switch($menu) { .... }

Anyways what OP is saying in that question?
@YogeshSuthar Lol, I didn't even notice that it's not in english xD
@HamZa That's why I have written it in my answer. ;-)
PLB
PLB
@Jack I guess, closing that question because of lacking minimal understanding of problem would also be fine. ;)
@HamZa What a edit. OMG
10:02
Hi!! Can anyone tell how to fetch and update multiple tables with loop?
I want to update all wp_int_options table.
@YogeshSuthar translating !
@PiyushArora We hate WP
Whats wrong with wp?
here int is number ie 1,2,3
PLB
PLB
@HamZa But you love [potential] help vampires so much, I guess, you'll help. :p
@PLB Ain't nobody got time for that :p
But, this is related to php and mysql
10:04
@PLB ps: depends on the mood
you need not to dig into wp :)
PLB
PLB
@PiyushArora explode, foreach
@PLB How would you fetch all tables first?
@PLB I thought of that, but at least he tried something :)
@YogeshSuthar Why reject that edit?
10:06
There are around 154 table with name wp_number_options.
@salathe There's some weird stuff inserted, other than the code format fix.
Ohhh
that's the translation lol.
@Jack yeah lol
@Jack By weird stuff, you mean English...
@salathe Because its invalid. Editor should remove non-english words too.
PLB
PLB
@PiyushArora Personally, I would first think of how I could do that with existing stuff, if this would be too ugly and dirty, write on my own, otherwise follow my solution with existing stuff.
10:07
@salathe Yeah, I didn't actually read it hehe
@YogeshSuthar I disagree.
@YogeshSuthar The edit is valid, just not what we want the finished question to be.
@YogeshSuthar You could improve it
@dragon112 I knows, because you approved it. :)
It's an improvement over the existing question!
10:08
Which is a bad question anyway ;-)
@PLB: I am not getting you. I want to use update query on multiple tables.
Yogesh Suthar has approved 878 edit suggestions and rejected 181 edit suggestions
@Jack That doesn't take away from the fact that the edit in and of itself is good
@Mr.Alien so we should comment answers now? — dbf 6 mins ago
@YogeshSuthar And that doesn't mean you should reject because you can also improve the edit ;)
10:12
@dragon112 It's easier just to LOL or OMG at it and move along.
@Ocramius why is that an issue?
@salathe If you don't feel like improving it why be in the review section at all?
@dragon112 My thoughts exactly, but hey-ho.
@Gordon NEWSFLASH: autoloaders can take any random crap as the class name
user895378
@Ocramius I don't see a problem with that really. I mean, PHP invoked the function you registered. Afterwards no class named '../../foo' existed, so the script errored out.
user895378
@igorw ^^
10:17
@rdlowrey It's probably more a comment on the naive include $class . ".php"; autoloaders that are out there.
user895378
Oh, good point.
naive or efficient? :)
@Jack "Yes"
hehe
user895378
The problem, as usual, is people blindly using code they don't understand. Especially for something as simple as a class autoloader people should understand what the code they're pushing into production does and what potential holes it has.
user895378
10:20
That's not a PHP WTF IMO ... it's in the "only a problem for the worst developers alive" category.
guys urgent please :( ... uppercase of the first char after ' or ’ if the char is a vowel :'(
I'm becoming crazy
ahem, what have you tried?
I'm trying with a preg_replace
i need expert advice on custom made template parser. It works flawless on windows (development) environment. When uploaded to testing/production, sometimes it dont work, and there are no errors no nothing,
I checked by doing error_reporting(E_ALL); ini_set('display_errors',1);
@Jack You know regex ! You may save some victimes !
10:23
preg_replace('/(\'|\’)[aeiou]/i', "'", "L’autentica Basilicata Igt Bianco Dolce 2007");
@HamZa Me? <.<
italian wine btw :)
I don't like whites .. white wines that is.
me too
however I'm totally a mess with regex
Btw, use a callback for the upper casing.
10:24
a callback?
@Jack Your first version looked pretty racist :p
@Jack get it preg_replace_callback right?
@dragon112 that was the joke...
@dragon112 I realized that shortly after writing lol
Jay
Jay
Hey guyz, m new in this chat room, can any one one tell me why is this chat room for?
10:25
@Jay Because PHP.
@salathe and? I just don't see the problem with it. Does that pose a security risk?
@jay its for PHP help
@Jay Parents Helping Parents
@Hamza :P lol
@Gordon I don't know what @igorw's point was
10:26
@AamirMahmood :-)
Jay
Jay
@HamZa ohh i see...
but can't I simply preg_replace('/(\'|\’)[aeiou]/i', strtoupper(), "L’autentica Basilicata Igt Bianco Dolce 2007"); ?
holy sh- this website just scared the shi- out of me t2547.com (not a screamer, just phishing)
@gr4devel nope
@HamZa ok
10:27
@HamZa where are you from?
@HamZa but actually I need to get the first vowel after the ' or ’
and now I can only the ' or ’
not the next letter
PLB
PLB
@gr4devel ['`]([aeiouy])
@gr4devel lookbehind
@PLB thnx man trying it
PLB
PLB
10:29
Btw, escape special chars depending your code.
@salathe there's actually no malware, it's just phish :P best idea not to go on it anyways
this is what it looks like for me:
@PLB nothing
escaped [\'`]([aeiouy]) but nothing is matched
damned regexp
@salathe ok. thanks.
genius xD
10:33
They couldn't get even my country correct. :(
@Jasper I think it was unintentional ;)
yesterday, by HamZa
@Mr.Alien @dragon112 I've got arabic blood, dutch and indonesian. I'm the mixed human being :D
@dragon112 at first
JTG
JTG
bleach?
PLB
PLB
@gr4devel 3v4l.org/pj29p
10:35
@JTG no naruto
@PLB talking about helping helpvampires :p
@salathe This site points me to yoursuperdating.com :p
JTG
JTG
^ same
What would be the main reason for General error in PDO
PLB
PLB
@HamZa Fair enough. :P
@HamZa Owww burn!! :p
10:37
@PLB thanks man I'll try to fix the thing �
Aww wrong one :)
@PLB That throws away part of the matched string, breaking the result.
@HamZa Thanks but nothing there for me
PLB
PLB
@gr4devel Oops, 3v4l.org/L0JX7
@salathe Thanks. :)
10:41
any one can help me tracking down an issue?
@PLB give me your address man...I'll send you flowers and candies! You saved my life :)
@PLB now I'll try to understand the code so that in the future I'll can go by self :)
any one?
but hey you're great!!!
PLB
PLB
@gr4devel Well, I don't need them. Just try not to take projects where people are trying to kill you. :P
10:42
> Discussion for all things PHP - Don't ask whether someone is here to help you. If someone is around and wants to help they will.
2
@PLB good advice thanx man ;)
btw if I can help you in anyway just write down my name :)
:) thanks, my template parser works on windows, and when uploaded to server (centos), its output is not determined. it will keep working for months and years, but suddenly will stop outputting
PLB
PLB
@salathe I don't like lookbehinds (don't know why).
Good evening :)
@PLB Maybe they don't like you. :)
10:44
@PLB lulz, E_NEED_ARG
the same file is working fine on local, but not on server, tracking down to single line, and it is a simple $template->replaceVar('CLIENT', $client); line. and there is data too so not sure why whole template is discarded
@kodewrecker hi
@DaveRandom Well thank you for the epileptic attack.
PLB
PLB
Probably, because regex is not readable itself and lookaheads/lookbehinds make it even uglier (for me, at least).
@PLB They are powerful and you will thank the creators of PCRE for implementing. Just look at JS and how it fails since it doesn't support lookbehinds. ..
10:46
@PLB 3v4l.org/Wlg3m then :)
PLB
PLB
@HamZa I have not said they are not.
@PLB ok
PLB
PLB
@salathe This one is really nicer. nice solution.
Hello everyone :)
Are there experts with PayPal Sandbox testing?
@salathe @PLB What about :p \/
$str = str_replace(array("'a", "'e", "'i", "'o", "'u", "`a", "`e", "`i", "`o", "`u"), array("'A", "'E", "'I", "'O", "'U", "`A", "`E", "`I", "`O", "`U"), $str);
10:52
Guys could anyone please tell me if there is anything wrong with this function. SOMETIMES it returns an empty string.
public function gettopicname(){
$ret = "";
$length = 4;
$rando = $this->rando($length);//Generates a random string
$rando = (string)$rando;
$tname = "nm".$rando;
$check = $this->checktopicname($tname);//Checks if tname already exists in the database
if ($check){
$this->gettopicname();
}
else{
$ret = $tname;
}
return $ret;
}
@HamZa and now for the other types of quotes...
@salathe :ragequite: xD
Hi, is there anyone integrated Tally with PHP ?
@rdlowrey $foo = '..\..\..\..\root\.ssh\id_rsa'; new $foo;
PLB
PLB
@HamZa Great for maintainability. :P
10:54
@user2115154 basic debugging ...
@rdlowrey is that enough of a security issue? =D
@Hamza Sorry my knowledge is "basic" :)
user895378
@Ocramius this is why php has things like basedir restrictions. Anyone not protected by that kind of restriction deserves whatever they get for being stupid.
user895378
35 mins ago, by rdlowrey
That's not a PHP WTF IMO ... it's in the "only a problem for the worst developers alive" category.
@rdlowrey it's still unexpected behaviour that is potentially exploitable
user895378
10:55
How is is_callable('var_dump'); // bool(TRUE) unexpected behavior, though?
How do I make a query search for lastseen time between CURTIME() and CURTIME-3000 ?
@Ocramius What if I really do want to autoload my ..\..\..\..\root\.ssh\id_rsa class?
@Tredged update user table with time stamp on each page refresh, and then check for timestamp is in the range
@AamirMahmood 1st one I have done, second one I dont know how to fetch between now and -30mins probably between but I didnt succeed.

« first day (1019 days earlier)      last day (4155 days later) »