@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23



Comments:

<0> sean`: think of that 'who' as 'why'
<1> i have NO errors from that part of code
<2> ah
<3> Sigh. s/Who/Why/
<4> mrtechguy, check out the url Stormchaser just gave you, it will answer your question..
<3> Didn't notice the typo.
<2> Stormchaser; My KimmoA decoder
<0> mrtechguy: Are you illiterate? Have you even LOOKED at the link I posted?
<2> mrtechguy; <6> Parse errors show the line where parsing failed, not nessicarily where you made your mistake. Try looking a line or two above the reported error.
<1> yes I have
<2> " not nessicarily where you made your mistake"
<0> mrtechguy: no you didn't
<4> dont just look, read it too ;>
<2> KimmoA; Beats me.. I think they just want to be part of our cool gang :p
<0> <0> mrtechguy: php.net/if
<1> I have read it



<1> if ($a > $b) ; etc etc
<2> mrtechguy; What do you want your IF to do?
<0> mrtechguy: Yes, and that goes with your code... how?
<1> I want my if to determine if the the varible "day" is that same as the date
<2> if ($_GET['day'] == $day_date)
<0> mrtechguy: yes, and how should that make your code valid?
<2> NO ";" after the parenthesis.. you just put the {
<1> what do you mean how should it make the code valid
<1> sean` ur a f****** legand
<2> legand?
<5> legend? :)
<1> you have helped me
<0> !+typing english
<6> ##PHP does not allow aolbonics (or leetspeak) such as "u for you, r for are, ic for i see -- etc" and typing like this will result in you being silenced; furthermore, inability to adapt may result in a ban.
<1> soz too late
<2> Oh oke, I was thinking... don't insult me.
<1> I am going ot be now
<7> hm, I have a cl*** variable A, from within a cl*** method B I call another cl*** method C and I ask it to use a method of that cl*** variale A (it is another object), say '$this->$A->method();'. It does not work. I try to call it from method B directly and it works. It just doesn't work from cl*** method C (which I call from within cl*** method B). Why is that?
<7> it is as if cl*** method C does not see the cl*** variable A
<2> electrofreak; Cl*** variables will remain in the cl*** forever..
<2> Learn about scopes
<7> sean`, I don't see why the a cl*** variable goes out of skope of a cl*** method when this is called from within another cl*** method
<2> electrofreak; Pastebin your code, might be a misunderstanding
<2> $this->$A->method(); -> This means you have a variable $A defined where you are calling it..
<2> If you want to get the variable A from the object $this.. you should use $this->A->method ();
<7> cl*** Example { var A; function B () { $this->$A = "Hello!"; C(); } function C { echo $this->$A; } } It does not work.
<2> electrofreak; $this->A;
<7> I have just tried that too but I get the same error
<2> And you'll still have another problem.
<2> You are calling the function C, not the method C
<0> and it should be $this->C();
<2> $this->C (); would be calling the method C
<7> yes, in the actuall code I do this
<7> sorry about the error here
<2> eleftherios; Pastebin your code
<7> ok, I will do that
<7> one second please
<8> I have to check, whether a variable contains only integers and whether the variables are not empty. so first I check whether they are empty, but empty also is TRUE if the variable contains the int 0
<8> how to come around this problem?
<5> nk_: isset, is_numeric ?
<0> eleftherios: The one you HAVE, not the abstract one.
<8> alakazam: isset unfortunately also is always true
<2> if (!empty ($var) && ctype_digit ($var))
<0> er. no
<2> hmm
<2> oh, didn't read the last part
<2> (isset ($var) && ctype_digit ($var))
<0> if (!isset ($var) && ctype_digit ($var))1
<5> nk_: if (isset($a) @@ is_numeric($a))
<7> Stormchaser, yes I will paste the one I have :-)
<0> o.O
<2> Stormchaser; Why the !isset, alakazam @@?
<0> s/paste/pastebin
<0> sean`: oops... I abused your code and forgot to erase the !
<5> @@ => goofy ridiculous error :)
<8> sean`, alakazam: I set those variables by a POST-form. so I guess it is always set, even if the field in the form is empty
<2> alakazam; Instead of is_numeric, use ctype_digit
<5> nk_: not necessarily, it is better to check with isset, and sean` is right, ctype_digitis probably better
<2> nk_; An extra check is never wrong
<0> heh... 'digtis'
<2> Lol



<9> dig this.
<5> (except for negative values?)
<2> people making typos out of typos
<8> I do the check with a regex. preg_match('/\D/', $foo)
<2> digit -> digitis -> digtis
<2> nk_; Why?
<7> sean`, Stormchaser there's the code http://pastebin.com/649307
<5> nk_: augh, *slow*
<2> That would only be adding fat to your script..
<8> sean`: *shrug* :) my problem is not the digit-check, the problem is the isempty-check
<5> nk_: isset then ,and is_numeric, that way you are certain it is an numeric value (albeit not an integer)
<2> nk_; if (!ctype_digit ($var) && empty ($var))
<2> Ow, turn them around, otherwhise you might get an error..
<5> sean`: the other way around? empty, and then ctype, otherwise :)
<10> Can someone confirm: If I Cl***A extends Cl***B, and I want to call submit() from Cl***B, but only after some preprocessing in Cl***A, I should create Cl***A::submit() which calls parent::submit() right? parent::submit() calls it as a method on the current object rather than as a cl*** method?
<5> yup ;)
<7> sean`, Stormchaser which I call from this little test script for now: http://pastebin.com/649308 (just for completeness)
<2> Woosta; cl***name::method (); only calls the method.. You could see it as a function call.. It is independant from the cl*** itself
<2> from the cl*** it belongs to *
<0> $this->$fieldnames[$i] = $temp->name; <-- WTH?
<2> $this->$rs = $rs ?
<7> sean`, Stormchaser the error I get is Fatal error: Call to a member function on a non-object in line 99.
<2> eleftherios; Read up on php.net/language.oop
<7> I have read that sean`
<10> sean`: that makes sense .. so how do I call the parent's function on the object? Calling $this->submit() will just call the function in Cl***B ..
<2> eleftherios; Thn read it again..
<8> sean`: if regex'es are so bad for performance... how do I turn around dates from mysql, that is YYYY-MM-DD in human readable form like DD.MM.YYYY without a regex?
<7> sean`, can you be more specific at what I should look at please?
<5> nk_: using mysql functions
<2> Woosta; if cl***A extends cl*** B, and both have a submit function.. the submit function of the current cl*** you are working in will be called
<5> http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
<2> If I am correct..
<2> nk_; What about MySQL the function DATE_FORMAT ?
<10> sean`: yeah, but how do I call the parent function? In perl I'd call $this->SUPER::submit() ..
<8> i see.
<0> parent::function()
<8> but besides your if-phrase does not catch empty fields, don't ask me why
<2> Woosta; Parent? parent::method (); or you could rename the method in cl***A so it doesn't match the name of the method in cl***B
<10> Stormchaser: that's where I started .. but I'm told that will call it as a cl*** method rather than calling it on the current object
<11> Is it possible to extend an interface with another interface? I will I haft to extend the two interfaces seperately in a cl***?
<2> You could also create a new instance of cl***B within cl***A but that would be stupid
<8> is_Numeric works
<11> "I will" == "Or will"
<2> nk_; is_numeric ? then use ctype_digit.. they are the same.. the latter is only more secure..
<8> sean`: well the latter only does not work :)
<2> nk_; That can't be.
<8> *shrug* why shold I lie
<7> sean`, one think I didn't notice was the '__' function names which I now corrected. The error for line 99 still remains though :-/
<2> I don't know.. but it sounds strange to me..
<2> eleftherios; You can name a function __ as far as I know..
<12> window clear
<2> eleftherios; Prefixing a function with __ means it should only be used from within the cl***
<0> usually the _ should be used for 'private' methods. the __ is supposed to be reserved in PHP5/6...
<7> sean`, the language.oop says "" PHP reserves all function names starting with __ as magical. It is recommended that you do not use function names with __ in PHP unless you want some documented magic functionality.""
<2> __magic () { echo 'magical***'; }
<13> i want to write a framework with PHP, anyony knows a channel about MVC?
<0> try Zend Framework or PHPCake or PHPOnTrax
<0> hi, mazzanet
<14> Where can I edit my php.ini file in freebsd, 'cause I can't find it anywhere? I installed php as apache module and php works with apache ok.
<15> hi, Stormchaser
<15> i have the most useful function of all time for you
<9> Zing: phpinfo() tells you.
<0> mazzanet: givemeWhatImeanNotWhatIwrite()? :)
<15> http://news.php.net/php.notes/107576
<13> Stormchaser: i dont want to reinvite the wheel, i know i can use any existed frameworks but you know i whant learn more about those and i think the best way of that is writing one!
<2> reinvite?
<13> sean: ?
<0> mazzanet: lol :)
<2> raidman; You can also look at those frameworks.. so you know how a good framework should be put together.. that will be useful..
<2> reinvite -> invite someone again for a feature time.. you mean reinvent
<2> Writing one yourself is a good way to learn.. but analyze their structure.. so you know you learn good stuff..
<13> sean`: this is good idea but before that i should learn more about MVC! this is my problem -> MVC
<13> sean`: reinvite => reinvent sorry


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

#linuxhelp
configure trackpoint ubuntu -thinkpad
Fedora Unable to access jarfile startup.jar
ubuntu smb mp3
+preseed +partman +primary partitions
#php
#centos
#css
Tcl error [evnt:init_server]: missing
#perl



Home  |  disclaimer  |  contact  |  submit quotes