| |
| |
| |
|
Page: 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 26 27 28 29 30 31 32 33
Comments:
<kuja> caffinated: I do my friendly humping, and I get them answers. There's always the ***es and helpful ones, (I'm the *** of ##php). <Jymmm> strobedream: Nah, they dont charge extra shipping for backorders... and the cost of the item elsewhere is like $40-$90, they're selling it for $15. <b1n0ry> can a cl*** definition include multiple parent cl***es? <boneill> BarnacleBob: run it through mysql_escape_string or addslashes first <kuja> caffinated: You're Rails-centric though, right? <BarnacleBob> boneill, great thanks <Cheesecheese> adding and subtracting dates from each other - which functions do i need to be looking at? <strobedream> Jymmm: ahh thats kinda nice then <^Artnez> anyone know how to check a string for PHP errors? <Jymmm> !+f date <php-bot> Try looking at http://php.net/date <boneill> BarnacleBob: I'm not 100%, but i doubt a serialised string gets MySQL specific things slashed <kuja> outofjungle: I am not wrong, you are wrong. __FILE__ is what gives you what you want (by description). You are probably incorrectly using it. <Cheesecheese> that doesn't cover the adding and subtracting of dates, unless you can point to it specifically for me. <BarnacleBob> boneill, yeah i would doubt they get slashed but i wondered if serialzed strings even had that sort of stuff <caffinated> kuja: I don't see rails and ruby as being the same thing. when I ask ruby questions, I make sure they're not related to rails. <CryWolf> ^Artnez: can you rephrase the question? <CryWolf> Cheesecheese: strtotime <Cheesecheese> crywolf: ta :) <kuja> outofjungle: foo.php: <?php echo __FILE__; ?> bar.php: <?php include 'foo.php'; ?> -- Output is '/path/to/foo.php' <FatalRemedy> if I have an array of arrays $foo, and want to access array $bar at key "time", how do I do that? <^Artnez> CryWolf: $expression = "cheese+4"; eval( $expression ); would throw a parse error <boneill> b1n0ry: I don't think they can <^Artnez> CryWolf: i remember there was a function in PHP that could check a string for errors <b1n0ry> boneill: i didn't think so either, thought i'd ask, though <outofjungle> kuja: i want the executed script name. not the included file name. the vice versa of your example <FatalRemedy> $foo[bar][time] ? <kuja> outofjungle: print_r($_SERVER) <CryWolf> ^Artnez: I know of no such function. However, if you're using eval (always a questionable thing to do), you should be doing much more checking of the string first. <kuja> caffinated: I notice though, even the inexperienced who stay and familiarize themself enough get well fed. <caffinated> kuja: I'll be attending the next rubyconf when it happens, I can always verbally abuse them when I get there heh <^Artnez> CryWolf: it's for expermination, i normally never use eval() .. ever <kuja> caffinated: Haha <outofjungle> kuja: i got $_SERVER['_'] on php5, but i was asking if there is any on php4 <kuja> caffinated: Matz will be speaking? <kuja> outofjungle: I don't know what that is. <BarnacleBob> outofjungle, thats easy. all of these return it from $_SERVER: SCRIPT_FILENAME, SCRIPT_NAME, PHP_SELF <BarnacleBob> outofjungle, sorry that was ment for kuja <BarnacleBob> kuja, thats easy. all of these return it from $_SERVER: SCRIPT_FILENAME, SCRIPT_NAME, PHP_SELF <luked> hi! is there any software (eg eclipse plugin) which analyzes my sourcecode and tells me which function takes how many seconds? <kuja> BarnacleBob: ...um, what? <kuja> BarnacleBob: outofjungle needs the help, not me. <BarnacleBob> kuja, roffle i'm stupid :) <BarnacleBob> i got it right the first time <LarsK> Hi! Can somebody help me with this code? http://www.phpriot.com/2803 <b1n0ry> should constructor functions be declared public or private or not at all? <kuja> b1n0ry: Declaring a constructor private is of no use unless you want to implement a Singleton pattern. <kuja> Constructors are usually public. <Solara> eh keylogger commands? <kuja> If 'public' is omitted, then it's ***umed public, like any other method that has omitted one of the P's. <`Jay_> hey, using mail() -fsender doesn't help to change the sender , it still remains apache@server ... anyway to change this ? <boneill> `Jay_: add the from headers <CryWolf> LarsK: using arrays helps you avoid variable variables. <`Jay_> boneill: done that too and the return-path <b1n0ry> kuja: ok, i was merely looking to include some uniformity to my cl*** definitions <kuja> b1n0ry: It is my personal preference in style to *always* include a public/protected/private. <LarsK> CryWolf: How can I use arrays in this problem? <kuja> So, I personally would do: public function __construct() <b1n0ry> kuja same here, i just didn't know whether the constructor is normally public, protected or private <kuja> b1n0ry: Public, of course :) <CryWolf> LarsK: $Mod[1], $Mod[2], etc...and then, you access $Mod[$Module_IDNR] <AcidReign> kuja: you're posing nude in public? what?! <^Artnez> b1n0ry: PHP throws and error if you do anything but public <b1n0ry> kuja: graci <kuja> b1n0ry: np <b1n0ry> ^Artnez: was not aware of that <kuja> AcidReign: Aw, you missed the show. Too bad. Only caffinated got the goodies. <LarsK> `Jay: $headers = 'From: name <email@domain.com>' . "\r\n" . <LarsK> 'Reply-To: email@domain.com' . "\r\n" . <LarsK> 'Return-Path: email@domain.com' . "\r\n" . <LarsK> 'X-Mailer: PHP/' . phpversion(); <LarsK> <LarsK> $mailsend=mail("email@domain.com","subject","$emess","$headers"); <kuja> Mm... fun. <CryWolf> !tell LarsK about flood <LarsK> sorry <`Jay_> LarsK: thank you, but that almost exactly what I'm using to mail() <b1n0ry> !tell LarsK about pastebin <AcidReign> LarsK: I'll let that slide once. <LarsK> ok <kuja> AcidReign is too kind. :) <kuja> EBIL! I demand EBIL, now! <b1n0ry> man, have some fun, dude <b1n0ry> ;) <AcidReign> *hahaha* <kuja> :D <LarsK> CryWolf: How can I get that for the sql, when they all are in the same row, and the meaning is to add and delete the fields? <CryWolf> LarsK: ah, and the problem with variable variables becomes apparent. It's not obvious what you're trying to do. <b1n0ry> ok, i have a situation that is not at all unique (at least i wouldn't think so). i have a cl*** that i want to call and based on a parameter p***ed to the constructor of that cl***, i want to include the appropriate code for the functions. this would be an API of sorts. <`Jay_> LarsK: and the -f switch is usually for sendmail, altough it should also apply to exim ... but now it doesn't <CryWolf> LarsK: maybe something like $fields[$field] = $value; and then later on set $field to whatever string you need to. or foreach through $fields. <b1n0ry> i'm thinking, though that merely include'ing some file in the constructor function would be less-than-desirable and likely cause problems. <CryWolf> ^Artnez: I have no function <^Artnez> CryWolf: my fault, i need gl***es <kuja> b1n0ry: You shouldn't include files in cl***es, *ever*. <BarnacleBob> b1n0ry, you mean you want to basically include the php file for the functions in the cl***? <CryWolf> speaking of which, it's time for me to head out to my weekly staff meeting. :p <kuja> I need a more productive life :) <^Artnez> kuja: join the army <kuja> The Army uses ASP. <kuja> :( <b1n0ry> kuja and BarnacleBob: understood about including the functions. here's an example. suppose i have a database api and one of the parameters to p*** to the function is the database platform. thus i want the cl*** to be "built" based on that database type. that's just one example of such an application. <zeeeee> hi all, is there any way (what's the best way) i can embed an image binary directly into a page and have it displayed? (this would save me from having to write server-side generated images to files) <BarnacleBob> b1n0ry, extend the cl*** to the right type. i have that exact setup <kuja> b1n0ry: <?php require_once 'db.php'; cl*** YourDB extends DB { } ?> <virus> SoftException in Application.cpp:233: Directory "/srv/httpd/(...)", *** glibc detected *** double free or corruption (fasttop): 0x08070a90 ***, referer: (...) --- anyone knows how to fix that one? I'm using suPHP 0.6 with PHP 5.1.x <BarnacleBob> b1n0ry, i could tar my dbi up for you and you can see how i did the call right cl*** depending on type <b1n0ry> BarnacleBob: but how do i get around "including" all of the cl*** files for all of the different database types? i only want to "include" the proper type. <bartel> is there anyway to get the name of the "first" field in a cl*** in PHP4? <luked> would zend studio analyse the sourcecode? <bartel> odd request I know, and I doubt you can but worth a shot <BarnacleBob> b1n0ry, i set it up so i had to include (dbi.cl***.php); include(dbi_mysql.cl***.php); <^Artnez> bartel: first property.. you mean? <`Jay_> anyone else an idea why apache@domain keeps popping in when using mail() -fsender option ? (exim mailserver) <b1n0ry> BarnacleBob: but i won't know if the user instantiates the type as mysql, mysqli, pgsql, mssql, etc. <^Artnez> BarnacleBob: what's wrong with including cl*** files within a cl***? <BarnacleBob> b1n0ry, then in the cl*** it would check if the sub cl*** that you actually wanted exsited and go on from there <kuja> Davey|Work: Crtx's DB implement was an ORM layer for PDO, right? <BarnacleBob> ^Artnez, i never said that <kuja> implementation, eve. <kuja> even.. <kuja> Uh, mmcc in the HOUSE <kuja> ;) <b1n0ry> BarnacleBob: so you would imply to put an "include" statement in the cl*** constructor? <^Artnez> b1n0ry: i have a database cl***, it is instantiated like so: $db = new database; $db -> add( "main", "mysql" ); <outofjungle> kuja, BarnacleBob: the $_SERVER['_'] is something new to me too. i'm seeing it in PHP5 and not in php4. i wanted to have the code work in both versions of PHP, but i dont get that info from the $_SERVER on php4 <kuja> Jymmm: Spring cleaning. Yummy. <b1n0ry> i would just use PEAR::DB (or any of the other pre-mades) but i haven't found one that isn't "bloated" <BarnacleBob> outofjungle, dont use that. use basename($_SERVER["SCRIPT_NAME"]); <kuja> b1n0ry: Well, I have an idea... read the source to PEAR::DB and see how they do it. So you get the basic idea of how to do your own. <BarnacleBob> b1n0ry, no no no not at all <^Artnez> b1n0ry: can i PM you? <b1n0ry> ^Artnez sure <b1n0ry> kuja: i'll look at it. miles and miles of code, i just thought there'd be an easy recommendation <BarnacleBob> b1n0ry, i have a cl*** factory setup for it basically (i think i'm not to up on the cl*** types stuff) <kuja> b1n0ry: You should probably look at DB.php and how it handles it. <outofjungle> BarnacleBob: the $_SERVER['SCRIPT_NAME'] does not work on cli. it works fine thru apache <mfonda> I recommend PEAR::MDB2, PEAR::DB is basically becoming deprecated <BarnacleBob> outofjungle, hang on i use one for cli i'll find it <outofjungle> BarnacleBob: thanks <b1n0ry> mfonda: i really don't care about the deprecitation. i'm not using it anyway, just want to see how the cl***es are instantiated. <Hali_303> hi! can you send me some cheap php hosting sites? (in private message) thx! <kuja> ... <kuja> Weird.
Return to
#php or Go to some related
logs:
#math #math gentoo xdm restart hang problem +installation +debian +partman* fedora pixma 4000
f0rest config #gentoo gentoo xorg freedesktop #sdl #gaim
|
|