logs archiveIRC Archive / Freenode / #php / 2006 / June / 11 / 1
MarkR42
Well, "global $x" is a shorthand for $x = & $GLOBALS['x'];
Koncept
does anyone know where i can find a base32_encode alithogram for php4
Crescendo
I need for a variable to be remembered beyond a class... so NEXT time the class is used, it's still the same...
http://pastebin.ca/63896
L1nX
Crescendo: A constant?
s|k
Crescendo: you probably want to take a look at how you defined your classes
Crescendo
Maybe, I don't know?
MarkR42
Crescendo: You should not shun globals completely, just try not to let them take over your app. Make them few and well documented, and it'll be fine.
I think you can also have static member variables
Crescendo
I'm somewhat of a newb to PHP.
Kinda learning as I go.
Again, that pastebin entry is what I have right now.
s|k
MarkR42: when would you use a global :|
         

Wolfpaws
Crescendo: IRC bots aren't a good place to start... They usually require a pretty advanced language knowledge
MarkR42
I normally do use globals, but only very few
Crescendo
Particularly in the 'fight' c;ass/
Eh, I didn't start there.
TheNinthCut
MarkR42, ok could you point me to some documentation or anything to show me how to store the results in an array, because my attempts haven't done so well.
MarkR42
s|k: I have a global $db for my connection
TheNinthCut
MarkR42, I suck at arrays.
Crescendo
I've been debugging PHP to the best of my ability on http://gwing.net for a while now
And phpBB isn't exactly the most clean PHP code you can find.
But yeah, how would I go about causing the fight class to remember what case it is in?
http://pastebin.ca/63896
s|k
MarkR42: yeah okay that makes sense, so they are passed by reference but if you unset $x you're only unsetting that pointer to that variable
is that right?
to that whatever
MarkR42
s|k: You're only unsetting the local $x, not the global one. It's weird.
s|k
yeah it sounds weird
MarkR42
Because global $x is a proper statement, not a lexical construct
s|k
I don't know what that means
ebsd
mark im stuck man
MarkR42
global $x really happens at runtime, not compile-time
ebsd
it used to work when i ran apache1 + php 4x
s|k
oh
got it
ebsd
now that just doesnt work care to help me one on one?
MarkR42
In other languages, such as when you do "import" in Java or "using" in C++ or C#, this is an entirely compile-time thing.
coldfyre
lets say a string is outputted as 10/2, how can i evaluate that show it would show as 5
dragova
can someone help me please i have foreach($xml['VIPDATABASE']['0']['VIPDATA']['0'] as $key => $value) i need the last ['0'] to increment for each array it finds how can i do this ?
         

alt_2
what is the time?
MarkR42
coldfyre: Well, you could use eval(), but eval() is a very very bad thing to use, for any purpose, if you're using it, then something is probably wrong. I can't remember who said it but someone said "If eval() is the solution, you're solving the wrong problem"
dragova
22:06 gmt
alt_2
dragova, ok
et
If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus Lerdorf
MarkR42
that's it
coldfyre
MarkR42: form the docs, eval isnt the right solution
Bread
window balance
dragova
(Action) waits patiently
Crescendo
How to remember the variable 'type' through multiple loops of the class 'fight' in http://pastebin.ca/63896
dragova
??
MarkR42
ebsd: I cannot help you to debug PHP crashing. It's probably down to either a build error, or a dodgy version of some underlying library, or something like a hardware fault. In any of these cases it's outside of PHP's scope.
ebsd
im just trying to toggle the debugging
since the script cant be executed cli style
MarkR42
ebsd: I would recommend that you try to reproduce the crash on the latest version of PHP, with no zend extensions installed. If you succeed, there may be a valid bug to report
ebsd
its not giving me much insight- just says segmentation fault on child process
ok - its the latest ver
i'll flick off zend
MarkR42
ebsd: Make the smallest script you can which triggers the error
run t
run it from CLI,
and remove *all* zend extensions
If it still happens then it could be a legit bug in PHP- believe me, I have reported several.
Crescendo
(Action) dances around the room, pauses for a moment, thinks about other useful things to do while waiting for an answer to his question
MarkR42
Crescendo: Ahh, that was a question? In English, questions don't start "How to". They also tend to end in question marks. Perhaps you meant "How do I ... ?"
Crescendo
How do I remember the variable 'type' through multiple loops of the class 'fight' in http://pastebin.ca/63896 ??
=D
MarkR42
Why not use a member variable?
In any case, you've done "global $type", which makes it global
Oh, you've also overwritten it with global $type = 1
I don't understand what you're trying to do, it doesn't make a lot of sense. And as it's an IRC bot it's fairly pointless anyway.
s|k
IRC bots are very useful
Crescendo
Erm, that class is called once every so many milliseconds, defined by user.
It will need to basically... post one thing, then another... in certain orders.
Wolfpaws
s|k: That depends on coder intellect
MarkR42
Crescendo: classes are not called, methods are called.
and why can't you use a normal instance member variable, if it's the same instance each time?
s|k
Wolfpaws: everything depends on coder intellect :)
if programmers organized we could rule the world at this point :/
Wolfpaws
s|k: That'd suck.
Crescendo
No idea, MarkR42... I don't know the difference.
How should I implement that function, then?
MarkR42
You have done already. the function is called training() isn't it?
s|k
Wolfpaws: not if I'm the leader, it would be free ice cream for everyone
espiering
linux2: how's it going?
linux2
espiering: its good. been busy working. lol
espiering: i need a team for my website
im never going to get it completed by myself in a reasonable time
espiering
yeah?
so your login is working now?
linux2
espiering: no not yet. haven't had time to work on it. i will at 6pm once my shift is over
espiering
ah, i see.
linux2
espiering: you know anywhere that i could kinda get a team to help me along with the project
i essentially need help at the moment with graphics and finish building the content management system that the site will run around
i have it estimated i will get it done by myself in 2009
espiering
haah
linux2
which isn't too bad. that would be the year i graduate from highschool
Koncept
what function is used to strip every char in a string to upper case?
espiering
i don't know any teams...
Koncept
nvm
linux2
over this summer i will probably be able to get a lot of it done
espiering: if you want you could help, if you have any free time
espiering
i could help
linux2
o awesome. give me 20 mins once im done with work and i will explain to you what the site it supposed to do
Noel4DMB
hello, I can't get GD to work. When i config with --jpeg and --png it goes through and it shows up in my config, but when i try to execute GD functions it tells me it's an error. Do i need to add a line to php.ini to enable GD?
amorphis
Koncept: ... cant u find it on php.net ... or google?
linux2
espiering: you use linux?
espiering
yup
linux2
makes things all the better
its kinda a funny story how i got my nic
amorphis
Koncept: strtoupper() Converts a string to uppercase letters
espiering
you chat this much on shift all the time?
anyone have any experience with setcookie() working for netscape but not for IE?
Noel4DMB
my GD area says PNG support is there but it doesnt say JPEG. what am i doing wrong?
linux2
espiering: sometimes. lol
amorphis
ny of u guys have some expierience with making rich text editor write to a sql DB
espiering
i always export to a delimited file, then upload into the db
MarkR42
amorphis: Yes, however the two are not related
Koncept
anyine know where i can get a working base32_encode function?
amorphis
MarkR42: I know ... but im having some stroubles making the thing work
Koncept
ive tried 2 one is for php5 and the other does not work properly
MarkR42
amorphis: Which one isn't working, the DB or the RTE?
linux2
espiering: wish i could help you with the cookie problem but i can't remember the last time i used IE
amorphis
DB is fine ... i just want 2 txt fields + RTE to write the outputs to the db
MarkR42
espiering: Some versions of MSIE don't accept cookies from certain sites unless they have a P3P policy -
LordFalcon
Anyone know about a php tutorial that teach me what $this->, is used for ? can't find something
MarkR42
Read the docs on MSIE
(and try it out on you dev site with various security / privacy settings of course)
amorphis
LordFalcon: its used for classes and stuff ... to get vars from parents :)
MarkR42
your dev site may be in the "intranet" zone due to not having a . in its hostname
LordFalcon
amorphis: hmm,.. But still, I don't understand :D a tutorial would be supah
amorphis
LordFalcon: i tried to understand it myself (im noob :p) ... i had no succes though
LordFalcon
amorphis: hehe
amorphis
MarkR42: Could u ... maybe ... write me the code? if u had a free minute?
MarkR42
amorphis: No, I cannot
simonbun
$this-> refers to the current instance of an object. Read up on php.net/php5
amorphis
MarkR42: did u use RTE urself?
MarkR42
amorphis: Yes, FCKeditor
LordFalcon
amorphis
i will look into that :) thanks
LordFalcon
Enjoy
MarkR42
There are others though which may be better
amorphis
LordFalcon: I will check it out myself ... thanks
espiering
Mark: p3p policy? can you point me where to learn more about that?
LordFalcon
no problem :)
briantumor
why is while(false !== ($file = readdir($handle))) correct and while($file = readdir($handle)) isn't?
Wolfpaws
briantumor: RTFM
briantumor
huh?
Wolfpaws
php.net/readdir should tell you all
briantumor
that's where i got it from
but it doesn't explain
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 next »