logs archiveIRC Archive / Freenode / #php / 2015 / July / 4 / 1
nezZario
$validColumns = ['manually', 'entered', 'columns']; $implodethis = []; foreach($validColumns as $column) { $implodethis[$column] = $_REQUEST[$column]; }
Happy_the_Exceed
nezZario, you could just instead write your own interface code using "interface {}". Then you add the methods that were used in spl observer and such. Throw it under a namespace: nezZario\mySpecialObserver
Something like that.
Since the abstract classes weren't concrete implementations anyway.
z1haze
oh i c
Happy_the_Exceed
Then you can unclock the ability to use any class you want.
nezZario
you need some isset()'s in that z1haze so consider that pseudo code, but that should get you started
z1haze
i thought that too but i've been testing the post data, and it doesnt send it unless it is set anyway
so i can just filter what is being passed, see what happens
nezZario
but then I could pass my own GET data and directly manipulate your query with few limits
Happy_the_Exceed, that makes sense
z1haze
alright, well thanks for the insight
nezZario
and of course, escape your values
         

z1haze
even if its not get? will it work like that with post too?
nezZario
GET, POST, doesn't matter, the user can pass whatever they want with very little effort
so make sure you validate user input thoroughly as NoiseEee said originally
z1haze
but using your validcolumns array i can compare
ill look into this more when i have time. Im being summoned now to leave xD thanks for the help
nezZario
Happy_the_Exceed, thanks.. I'm going to play with this some more
I've had a ton of fun with this code though :) that's always good
Sayona
Hello all
nezZario
Happy_the_Exceed, sorry
p4trix
good evening :D
wfpkhc
for some reason php isnt passing a variable to my javascript file - is there any reason for that? ill get code
Sammitch
beeeecause PHP and javascript are separate?
wfpkhc
http://privatepaste.com/276b02204b
the file is linked up correct could it be an order of operations?
Sammitch, - no sir, but thank you for the attempt
. /suggestion
Sammitch
your line is commented out in JS?
wfpkhc
it should still output it to JS though as text
http://privatepaste.com/e8a7e754e4 is the output
any ideas?
biberu
did you read the error message?
wfpkhc
the object cannot be found the problem is the object is there
or at least declared
biberu
no, it's not
wfpkhc
it is - thats why im thinking its an order of operations
biberu
if it was declared you wouldn't get an undefined variable message
wfpkhc
thats my point -
biberu
mine too
wfpkhc
my point is sharper though :D
         

biberu
a sharp pencil breaks easier
wfpkhc
you win sir
biberu
anyway you didn't provide enough context to resolve this, all we can say is what the error is telling you - at the point the script is running your variable isn't available
that is your problem, you need to figure out why
perhaps if you shared more code
wfpkhc
ill keep looking
i would have to share like 100 files :D
biberu
hardly likely
wfpkhc
and months of learning :D
im the pencil! dont argue :D
biberu
www.sscce.org
wfpkhc
just kiding
never had that link before
thats the problem
biberu
isolate it - the problem will be easier to share and you are likely to resolve it yourself in the process
Happzz
using pthreads, is there a way to tell if the parent is still alive, from within a thread?
wfpkhc
its not a short self contained code - it relies on a strict order of operations
Happzz
as in, i'd like the worker to die if the parent is erroring out for some reason
wfpkhc
thank you biberu
murderer Happzz
:D
just kidding
i have to go - thanks guys
biberu
the definition of short doesn't really matter, strip away all you can until only the problem remains
wfpkhc
thank you mr biberu
i will do that
thank you again sir
YamakasY
can someone visit codecanyon.net ?
Audioburn
can someone give me an example of a class that takers arguments?
SlashLife
Audioburn: A ... what?
Audioburn
class that takes arguments
SlashLife
Do you mean $obj = new Foo($args);?
Alphos
Audioburn classes don't take arguments. their methods (including their constructors) do, and sometimes their instances do (if the class implements an ::__invoke() method). but classes themselves don't
Audioburn
SlashLife, yea
oh
ok so __constructor would take the arguments by default?
SlashLife
Audioburn: the thing after new Foo will be passed to Foos constructor: function __construct(...)
Audioburn
ok cool
Alphos
be mindful, not all classes have constructors, not all constructors are public, and the method name is ::__construct()
zro
any suggestion for something like filps/whoops but perhaps lighter that I can use more like $output = (new Whoops())->handle($exception); ?
Alphos
zro what about the built-in stuff ?
Sayona
:**
Happy_the_Exceed
https://www.respectourprivacy.com/ wonderful...
evilbug
anyone else having issues installing/upgrading php on osx via homebrew?
that "preprocessor not found" error on make?
AndrewCarterUK
does anyone fancy giving their opinions on some software I'm about to release?
Audioburn
how can i use public variables in public functions
sorabji
example of what you're trying to do?
__adrian
Audioburn, perhaps you're looking for $this ?
class example{ public $var = 42; public function getVar(){ return $this->var; } }
(though, in many cases, your class properties will/should not be public.)
Audioburn
ty
__adrian
welcome. is that what you were asking about?
berezovsky
hey
does JSON inner arrays syntax contains into a square brackets or {} brackets?
here says http://www.w3schools.com/json/json_syntax.asp
in squares
but json_encode func in php make array into {} brackets
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 next »